nested-text 0.1.0

A fully spec-compliant NestedText v3.8 parser and serializer
Documentation
//! A fully spec-compliant [NestedText](https://nestedtext.org) v3.8 parser and serializer.
//!
//! NestedText is a data format similar to YAML but with no type ambiguity — all leaf
//! values are strings. No quoting, no escaping, no type coercion surprises.
//!
//! # Quick start
//!
//! ```rust
//! use nested_text::{loads, dumps, Top, DumpOptions};
//!
//! let input = "name: Alice\nage: 30\n";
//! let value = loads(input, Top::Any).unwrap().unwrap();
//!
//! assert_eq!(value.get("name").unwrap().as_str(), Some("Alice"));
//!
//! let output = dumps(&value, &DumpOptions::default());
//! let roundtripped = loads(&output, Top::Any).unwrap().unwrap();
//! assert_eq!(value, roundtripped);
//! ```
//!
//! # serde support
//!
//! Enabled by default via the `serde` feature. Since NestedText only has string
//! scalars, numeric and boolean fields are parsed from their string representation.
//!
//! ```rust
//! use serde::Deserialize;
//!
//! #[derive(Deserialize)]
//! struct Config {
//!     name: String,
//!     debug: bool,
//!     port: u16,
//! }
//!
//! let config: Config = nested_text::from_str("name: app\ndebug: true\nport: 8080").unwrap();
//! assert_eq!(config.port, 8080);
//! ```
//!
//! # Features
//!
//! - **`serde`** (default) — enables [`from_str`] and [`to_string`] for serde integration

mod dumper;
mod error;
mod inline;
mod lexer;
mod parser;
mod value;

#[cfg(feature = "serde")]
mod de;
#[cfg(feature = "serde")]
mod ser;

pub use dumper::{dump, dumps, DumpOptions};
pub use error::{Error, ErrorKind};
pub use parser::{load, loads, Top};
pub use value::Value;

#[cfg(feature = "serde")]
pub use de::from_str;
#[cfg(feature = "serde")]
pub use ser::{to_string, to_string_with_options};