# b3-rs A Rust implementation of [B3 (Better Binary Buffers)][b3]. **This library is in very early stages of development!** There is no guarantee of API stability until we reach `v1.0.0`. Parts of this library are heavily based on the original Python B3 implementation. [b3]: https://github.com/oddy/b3 ## Usage ```rust use b3_rs::{Item, ItemKey, ItemValue}; // Creating an item for a simple type let string_item = Item::from("item value").with_key(ItemKey::from("item key")); let integer_item = Item::from(123456u64).with_key(ItemKey::from(0u64)); // Creating an item collection let dict_item = Item::new( ItemKey::NoKey, ItemValue::CompositeDict( vec![string_item, integer_item] ), ); // Encoding items into the wire format let encoded = dict_item.encode()?; // Decoding items from the wire format let (decoded, byte_count) = Item::decode(&encoded)?; assert_eq!(byte_count, encoded.len()); assert_eq!(dict_item, decoded); ``` ## Caveats ### Unimplemented item types The following item types are currently unimplemented: - `Decimal` (type 10) - `Sched` (type 13) - `Complex` (type 16) The error `b3_rs::Error::UnimplementedB3TypeError` will be returned when a message contains any of these types. ## References * [B3 wire format documentation][wf] [wf]: https://github.com/oddy/b3/blob/master/wire_format.md ## License The code in this project is licensed under the MIT license. See the `LICENSE` file in the root of the repository for more information.