pub struct OptionalNbt(pub Option<NbtCompound>);Expand description
Wrapper for optional NBT that uses the protocol format (END tag for None).
This is different from Option<NbtCompound> which writes a boolean prefix.
In the Minecraft protocol, nullable NBT is represented as:
- Present: the compound tag bytes
- Absent: a single END tag byte (0x00)
Tuple Fields§
§0: Option<NbtCompound>Trait Implementations§
Source§impl Clone for OptionalNbt
impl Clone for OptionalNbt
Source§fn clone(&self) -> OptionalNbt
fn clone(&self) -> OptionalNbt
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptionalNbt
impl Debug for OptionalNbt
Source§impl From<Option<NbtCompound>> for OptionalNbt
impl From<Option<NbtCompound>> for OptionalNbt
Auto Trait Implementations§
impl Freeze for OptionalNbt
impl RefUnwindSafe for OptionalNbt
impl Send for OptionalNbt
impl Sync for OptionalNbt
impl Unpin for OptionalNbt
impl UnsafeUnpin for OptionalNbt
impl UnwindSafe for OptionalNbt
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