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:
parent
c255ab673a
commit
f89dc8e2bc
1 changed files with 10 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue