Skip to main content

Crate sickle

Crate sickle 

Source
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 Model navigation 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-capabilities to 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 entries
  • hierarchy: Build hierarchical model (build_hierarchy, load) - includes parse
  • printer: CCL printer for serializing back to canonical CCL text - includes hierarchy
  • serde-deserialize: Serde deserialization (from_str) - includes hierarchy
  • serde-serialize: Serde serialization (to_string) - includes printer
  • serde: Both serialization and deserialization
  • intern: String interning for memory efficiency with large configs
  • full: Enable all features

§Future Features (Planned)

  • section-headers: Support == Section == style headers
  • typed-access: Convenience methods like get_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;

Modules§

error
Error types for CCL parsing and navigation
model
CCL Model - the core data structure for navigating parsed CCL documents
options
Parse-time configuration options for CCL parsing behavior