mount-fstab 0.1.1

Type-safe /etc/fstab parsing, editing, and validation library
Documentation
//! # mount-fstab
//!
//! A 100% type-safe, memory-safe, thread-safe Rust library for parsing,
//! editing, validating, and writing `/etc/fstab` files.
//!
//! Implements the official fstab(5) semantics from util-linux, aligned with
//! libmount and glibc parsing behavior.
//!
//! ## Quick start
//!
//! ```rust
//! use mount_fstab::Fstab;
//!
//! let input = "UUID=root / ext4 defaults 0 1\n";
//! let fstab = Fstab::parse_str(input).unwrap();
//! assert_eq!(fstab.entries.len(), 1);
//! ```
//!
//! ## Modules
//!
//! | Module | Description |
//! |--------|-------------|
//! | [`error`] | Error types for all parsing and validation operations |
//! | [`escape`] | fstab escape sequence encoding and decoding |
//! | [`fstype`] | Filesystem type (fstab field 3) |
//! | [`options`] | Mount options (fstab field 4) with parsing and classification |
//! | [`parse`] | fstab string and file parsing |
//! | [`spec`] | Spec/source identifiers (fstab field 1) |
//! | [`types`] | Core types: `Entry`, `Fstab`, `MountPoint`, `EntryBuilder` |
//! | [`validate`] | Semantic validation of fstab entries |
//! | [`mod@write`] | Display formatting and atomic file writing |
//!
//! ## Features
//!
//! - **Parse**: Full fstab(5) format including all tag types (`LABEL`, `UUID`,
//!   `PARTLABEL`, `PARTUUID`, `ID`), NFS mounts, escape sequences
//! - **Edit**: Add, remove, replace entries with CRUD API
//! - **Validate**: Semantic checks matching `findmnt --verify`
//! - **Serialize**: Display formatting with proper escape encoding
//! - **Atomic write**: tempfile -> fsync -> rename for safe file updates

#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]

pub mod error;
pub mod escape;
pub mod fstype;
pub mod options;
pub mod parse;
pub mod spec;
pub mod types;
pub mod validate;
pub mod write;

pub use error::{
    EntryBuilderError, FsTypeError, FstabError, MountPointError, OptItemError, OptionsError,
    ParseErrorKind, SpecError,
};
pub use fstype::FsType;
pub use options::{MountPermission, OptItem, OptionClass, Options};
pub use spec::Spec;
pub use types::{Entry, EntryBuilder, Fstab, MountPoint};
pub use validate::{Diagnostic, Severity};