Expand description
§Sickle - CCL Parser for Rust
Sickle is a robust parser for CCL (Categorical Configuration Language) with optional Serde support.
§Features
- Two API styles: Direct
Modelnavigation or Serde deserialization - Complete CCL support: Lists, nested records, multiline values, comments
- Memory efficient: Optional string interning via feature flag
- Well-tested: Comprehensive test suite with property-based tests
§Quick Start
§Direct API
use sickle::load;
let ccl = r#"
name = Santa
version = 0.1.0
"#;
let model = load(ccl).unwrap();
assert_eq!(model.get_string("name").unwrap(), "Santa");§Serde Integration (requires “serde” feature)
use serde::Deserialize;
use sickle::from_str;
#[derive(Deserialize)]
struct Config {
name: String,
version: String,
}
let ccl = r#"
name = MyApp
version = 1.0.0
"#;
let config: Config = from_str(ccl).unwrap();
assert_eq!(config.name, "MyApp");
assert_eq!(config.version, "1.0.0");§Capabilities
For a comprehensive list of all supported CCL functions and parser behaviors:
- Auto-generated documentation: See docs/capabilities.md
- Dynamically generated from test data with coverage statistics
- Run
just sickle-capabilitiesto regenerate
§Cargo Features
By default, sickle includes only the core types (CclObject, Entry, Error).
Enable features to add functionality:
parse: Core parsing (parse,parse_indented) - returns flat key-value entrieshierarchy: Build hierarchical model (build_hierarchy,load) - includesparseprinter: CCL printer for serializing back to canonical CCL text - includeshierarchyserde-deserialize: Serde deserialization (from_str) - includeshierarchyserde-serialize: Serde serialization (to_string) - includesprinterserde: Both serialization and deserializationintern: String interning for memory efficiency with large configsfull: Enable all features
§Future Features (Planned)
section-headers: Support== Section ==style headerstyped-access: Convenience methods likeget_string(),get_int()list-indexing: Advanced list operations and indexing
Re-exports§
pub use error::Error;pub use error::Result;pub use model::BoolOptions;pub use model::CclObject;pub use model::Entry;pub use model::ListOptions;pub use options::CrlfBehavior;pub use options::ParserOptions;pub use options::SpacingBehavior;pub use options::TabBehavior;