#serde #ccl

no-std serde_ccl

Serde-based deserializer for CCL Documents

2 releases

new 0.1.1 Mar 4, 2025
0.1.0 Jan 30, 2025

#250 in Configuration

Download history 114/week @ 2025-01-30 8/week @ 2025-02-06 3/week @ 2025-02-13 5/week @ 2025-02-20 72/week @ 2025-02-27

90 downloads per month

MIT/Apache

27KB
777 lines

Serde CCL

Crates.io Documentation

Serde-based crate for deserializing CCL Documents.

Example

CCL document named example.ccl.

imports =
  = ~/.config/terminal/theme.ccl
  = ~/.config/terminal/font.ccl

dynamic_title = false
font_size = 12
shell = tmux new-session -A -s main

Code to deserialize the CCL document.

use serde::Deserialize;

const DOCUMENT = include_str!("example.ccl");

#[derive(Debug, Deserialize)]
struct Config {
  imports: Vec<String>,  
  dynamic_title: bool,
  font_size: f64,
  shell: String,
}

fn main() {
  let config = serde_ccl::from_str::<Config>(DOCUMENT)
    .expect("Failed to parse document");

  println!("{config:?}");
}

License

Sparsey is dual-licensed under either

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above without any additional terms or conditions.

Dependencies

~200–570KB
~11K SLoC