Skip to main content

nbt_rust/
lib.rs

1//! nbt-rust core library.
2
3pub mod codec_bridge;
4pub mod config;
5pub mod core;
6pub mod encoding;
7pub mod error;
8pub mod experiments;
9pub mod headless;
10pub mod limits;
11pub mod mcstructure;
12pub mod protocol_adapter;
13pub mod root;
14pub mod serde_api;
15pub mod tag;
16
17pub use codec_bridge::{NbtCodecFacade, NbtCodecProfile};
18pub use config::{NbtReadConfig, ParseMode};
19pub use core::{read_payload, read_payload_with_config, read_payload_with_limits, write_payload};
20pub use encoding::{
21    BigEndian, BigEndianCodec, Codec, Encoding, EncodingKind, LittleEndian, LittleEndianCodec,
22    NetworkLittleEndian, NetworkLittleEndianCodec, BE, LE, NLE,
23};
24pub use error::{Error, Result};
25pub use experiments::{
26    classify_experiment_key, is_known_experiment_key, read_experiments_from_root,
27    write_experiments_to_root, ExperimentKeyKind, Experiments, KNOWN_EXPERIMENT_KEYS,
28};
29pub use headless::{
30    from_headless_bytes, read_headless, read_headless_by_id, read_headless_by_id_with_config,
31    read_headless_by_id_with_limits, read_headless_prefixed, read_headless_prefixed_with_config,
32    read_headless_prefixed_with_limits, read_headless_with_config, read_headless_with_limits,
33    read_value, read_value_with_config, read_value_with_limits, to_headless_bytes, write_headless,
34    write_headless_prefixed, write_value,
35};
36pub use limits::NbtLimits;
37pub use mcstructure::{
38    validate_mcstructure_root, validate_mcstructure_tag, zyx_flatten_index, zyx_unflatten_index,
39    McStructureSemanticReport,
40};
41pub use protocol_adapter::{ProtocolNbtAdapter, ProtocolNbtEncoding};
42pub use root::{
43    read_tag, read_tag_with_config, read_tag_with_limits, read_with_header_mode,
44    read_with_header_mode_with_config, read_with_header_mode_with_limits, write_tag,
45    write_with_header_mode, HeaderReadMode, HeaderWriteMode, RootTag, BEDROCK_FILE_HEADER_MAGIC,
46};
47pub use serde_api::{
48    from_be_bytes, from_be_bytes_named, from_be_bytes_named_with_config, from_be_bytes_with_config,
49    from_byte_array_tag, from_le_bytes, from_le_bytes_with_config, from_net_bytes,
50    from_net_bytes_with_config, from_root_tag, from_tag, to_be_bytes, to_be_bytes_named,
51    to_byte_array_tag, to_le_bytes, to_le_bytes_named, to_net_bytes, to_net_bytes_named,
52    to_root_tag, to_tag, NbtByteArray, SerdeBehaviorContract, SERDE_BEHAVIOR_CONTRACT,
53};
54pub use tag::{CompoundTag, ListTag, Tag, TagType};