Serde CCL
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 Deserialize;
const DOCUMENT = include_str!;
Other Examples
Deserializing Arrays
Arrays are deserialized as key-value pairs where the key is empty. Non-empty keys are ignored.
use Deserialize;
const CCL: &str = r"
values =
= 0
ignored = 1
= 1
";
Deserializing Enums
Enums are deserialized as key-value pairs where the key is the variant name and the value is the payload.
use Deserialize;
const CCL: &str = r"
none =
None =
rgb =
Rgb =
= 10
= 20
= 30
";
Deserializing Unit Enums
For enums containing only unit variants it's more convenient to deserialize them from strings instead of key-value pairs. This can be achieved using a simple macro.
use Deserialize;
const CCL: &str = r"
theme = light
";
define_enum!;
License
serde_ccl is dual-licensed under either
-
MIT License (LICENSE-MIT or https://opensource.org/license/mit/)
-
Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
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.