systemd_unit_edit/lib.rs
1#![deny(missing_docs)]
2#![allow(clippy::type_complexity)]
3#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
4
5//! A lossless systemd unit file parser and editor.
6//!
7//! This library provides a lossless parser for systemd unit files as specified
8//! by the [systemd.syntax(7)](https://www.freedesktop.org/software/systemd/man/latest/systemd.syntax.html)
9//! and [systemd.unit(5)](https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html).
10//! It preserves all whitespace, comments, and formatting.
11//! It is based on the [rowan] library.
12
13mod lex;
14mod parse;
15mod unit;
16
17/// Drop-in directory support
18mod dropin;
19
20/// Systemd specifier expansion
21pub mod specifier;
22
23/// Systemd time span parsing
24pub mod timespan;
25
26/// Systemd-specific metadata and domain knowledge
27pub mod systemd_metadata;
28
29pub use lex::SyntaxKind;
30pub use parse::Parse;
31pub use rowan::TextRange;
32pub use specifier::SpecifierContext;
33pub use timespan::{parse_timespan, TimespanParseError};
34pub use unit::{Entry, Error, Lang, ParseError, PositionedParseError, Section, SystemdUnit};