1
0
Fork 0
mirror of https://github.com/azalea-rs/simdnbt.git synced 2025-08-02 07:26:04 +00:00

slightly improve doc

This commit is contained in:
mat 2024-01-11 14:51:20 -06:00
parent c255ab673a
commit f89dc8e2bc

View file

@ -1,11 +1,18 @@
//! an unnecessarily fast nbt decoder.
//!
//! afaik, this is currently the fastest nbt decoder in existence.
//! simdnbt is a very fast nbt serializer and deserializer.
//!
//! It comes in two variants:
//! - [`borrow`](borrow), which can only read and requires you to keep a reference to the original buffer.
//! - [`owned`](owned), which can read and write and owns the data.
//!
//! `borrow` will always be faster, but can't be used for every use case.
//!
//! ## Example
//!
//! ```
//! use simdnbt::borrow::Nbt;
//! use std::io::Cursor;
//!
//! // Read
//! let nbt = Nbt::read(&mut Cursor::new(include_bytes!("../tests/hello_world.nbt"))).unwrap().unwrap();
//! assert_eq!(nbt.name().to_str(), "hello world");
//! assert_eq!(nbt.string("name").unwrap().to_str(), "Bananrama");