7 releases (2 stable)

Uses new Rust 2024

1.1.0 Feb 6, 2026
1.0.0 Jun 16, 2025
0.3.1 Jan 18, 2025
0.3.0 Dec 24, 2024
0.2.0 Nov 28, 2024

#92 in Configuration

Download history 1531/week @ 2025-11-11 1384/week @ 2025-11-18 1288/week @ 2025-11-25 1374/week @ 2025-12-02 1785/week @ 2025-12-09 1593/week @ 2025-12-16 1356/week @ 2025-12-23 1244/week @ 2025-12-30 1636/week @ 2026-01-06 1646/week @ 2026-01-13 1742/week @ 2026-01-20 1610/week @ 2026-01-27 1675/week @ 2026-02-03 1953/week @ 2026-02-10 1747/week @ 2026-02-17 1569/week @ 2026-02-24

7,324 downloads per month

MIT license

86KB
1.5K SLoC

Augeas bindings for Rust

Augeas is a library for reading, modifying, and writing a structured file, like configuration files.

This library is a low-level binding to the C API of Augeas, with a few abstractions to make it more idiomatic to use in Rust. It does not aim to provide a high-level API to manipulate configuration files, but rather to provide a safe and idiomatic way to interact with Augeas.

The main differences with the C API are:

  • Add clear and clearm methods clear values (instead of passing an Option to set/setm).
  • Add touch method to create a node if it does not exist.
  • Use a Span struct to represent the span of a node in a file.
  • Use a Position enum to indicate where to insert a new node.
  • Use an Attr struct to represent the attributes of a node.
  • Use a SaveMode enum to indicate how to save changes.

Usage

In Cargo.toml:

[dependencies]
raugeas = "1.0.0"

Summary

A typical interaction looks like this:

use raugeas::{Augeas, Flags};

let mut aug = Augeas::init(Some("/"), "", Flags::NONE).unwrap();

// Get the ip address for host.example.com from `/etc/hosts`.
let entry = aug.get("etc/hosts/*[canonical = 'host.example.com']/ip")?;
if let Some(ip) = entry {
    println!("The ip for host.example.com is {}", ip);
} else {
    println!("There is no entry for host.example.com in /etc/hosts");
}

// Add an alias for host.example.com.
aug.set(
    "etc/hosts/*[canonical = 'host.example.com']/alias[last()+1]",
    "server.example.com",
)?;

raugeas

crates.io CI

Rust binding for Augeas, a configuration editing tool.

These crates were initially forked from hercules-team/rust-augeas.

Requirements

  • Augeas >= 1.13.0
  • MSRV: 1.89.0

Design

This library is a low-level binding to the C API of Augeas, with a few abstractions to make it more idiomatic to use in Rust. It does not aim to provide a high-level API to manipulate configuration files, but rather to provide a safe and idiomatic way to interact with Augeas.

Dependencies

~0–2MB
~40K SLoC