Crate toon_format

Crate toon_format 

Source
Expand description

§TOON Format for Rust

Token-Oriented Object Notation (TOON) is a compact, human-readable format designed for passing structured data to Large Language Models with significantly reduced token usage.

This crate reserves the toon-format namespace for the official Rust implementation. Full implementation coming soon!

§Resources

§Example Usage (Future)

use toon_format::{encode, decode};

let data = json!({"name": "Alice", "age": 30});
let toon_string = encode(&data)?;
let decoded = decode(&toon_string)?;

Re-exports§

pub use decode::decode;
pub use decode::decode_default;
pub use decode::decode_no_coerce;
pub use decode::decode_no_coerce_with_options;
pub use decode::decode_strict;
pub use decode::decode_strict_with_options;
pub use encode::encode;
pub use encode::encode_array;
pub use encode::encode_default;
pub use encode::encode_object;
pub use types::DecodeOptions;
pub use types::Delimiter;
pub use types::EncodeOptions;
pub use types::Indent;
pub use types::ToonError;
pub use utils::literal::is_keyword;
pub use utils::literal::is_literal_like;
pub use utils::normalize;
pub use utils::string::escape_string;
pub use utils::string::is_valid_unquoted_key;
pub use utils::string::needs_quoting;

Modules§

constants
Constants
decode
Decoder Implementation
encode
Encoder Implementation
types
utils