Add documentation

This commit is contained in:
Alex 2022-11-18 12:54:56 +01:00
parent 7cb5ff2fc2
commit 4f354768b6
Signed by: lx
GPG Key ID: 0E496D15096376BE
1 changed files with 17 additions and 0 deletions

View File

@ -1,4 +1,21 @@
//! Functions to generate nettext representations of data structures
//!
//! Example:
//!
//! ```
//! use nettext::enc::*;
//!
//! let nettext_encoding = list([
//! string("CALL").unwrap(),
//! string("myfunction").unwrap(),
//! dict([
//! ("a", string("hello").unwrap()),
//! ("b", string("world").unwrap()),
//! ("c", raw(b"{ a = 12, b = 42 }").unwrap()),
//! ("d", bytes_split(&((0..128u8).collect::<Vec<_>>()))),
//! ]),
//! ]).unwrap().encode();
//! ```
use std::collections::HashMap;