pub struct NbtReader {
pub data: Vec<u8>,
pub cursor: usize,
}Expand description
Struct that is needed for the NBT reading
Fields§
§data: Vec<u8>A list of the whole data in bytes
cursor: usizeCursor, where we are currently reading
Implementations§
source§impl NbtReader
impl NbtReader
sourcepub fn from_compressed_data(data: Vec<u8>) -> NbtReader
pub fn from_compressed_data(data: Vec<u8>) -> NbtReader
function to create a new instance of NbtReader but before storing the byte array it gets
decompressed
§Arguments
data - List of the whole data in bytes
sourcepub fn read_be_i16(&mut self) -> NbtResult<i16>
pub fn read_be_i16(&mut self) -> NbtResult<i16>
sourcepub fn read_le_i16(&mut self) -> NbtResult<i16>
pub fn read_le_i16(&mut self) -> NbtResult<i16>
sourcepub fn read_be_u16(&mut self) -> NbtResult<u16>
pub fn read_be_u16(&mut self) -> NbtResult<u16>
sourcepub fn read_le_u16(&mut self) -> NbtResult<u16>
pub fn read_le_u16(&mut self) -> NbtResult<u16>
sourcepub fn read_be_i32(&mut self) -> NbtResult<i32>
pub fn read_be_i32(&mut self) -> NbtResult<i32>
sourcepub fn read_be_u32(&mut self) -> NbtResult<u32>
pub fn read_be_u32(&mut self) -> NbtResult<u32>
sourcepub fn read_var_i32(&mut self) -> NbtResult<i32>
pub fn read_var_i32(&mut self) -> NbtResult<i32>
sourcepub fn read_var_i64(&mut self) -> NbtResult<i64>
pub fn read_var_i64(&mut self) -> NbtResult<i64>
sourcepub fn read_zigzag_var_i32(&mut self) -> NbtResult<i32>
pub fn read_zigzag_var_i32(&mut self) -> NbtResult<i32>
function to read a ZigZagVarInt
§Returns
Returns the value or an error, why whe read operation failed
sourcepub fn read_be_i64(&mut self) -> NbtResult<i64>
pub fn read_be_i64(&mut self) -> NbtResult<i64>
sourcepub fn read_be_u64(&mut self) -> NbtResult<u64>
pub fn read_be_u64(&mut self) -> NbtResult<u64>
sourcepub fn read_be_f32(&mut self) -> NbtResult<f32>
pub fn read_be_f32(&mut self) -> NbtResult<f32>
sourcepub fn read_be_f64(&mut self) -> NbtResult<f64>
pub fn read_be_f64(&mut self) -> NbtResult<f64>
Auto Trait Implementations§
impl Freeze for NbtReader
impl RefUnwindSafe for NbtReader
impl Send for NbtReader
impl Sync for NbtReader
impl Unpin for NbtReader
impl UnwindSafe for NbtReader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more