Skip to main content

NbtNumeric

Trait NbtNumeric 

Source
pub trait NbtNumeric {
    // Required methods
    fn codec_bool(&self) -> Option<bool>;
    fn codec_i32(&self) -> Option<i32>;
    fn codec_f32(&self) -> Option<f32>;
    fn codec_f64(&self) -> Option<f64>;
}
Expand description

Decodes numeric NBT tags with the conversions performed by vanilla’s DynamicOps number codecs.

Required Methods§

Source

fn codec_bool(&self) -> Option<bool>

Decodes Codec.BOOL from any numeric NBT tag.

Source

fn codec_i32(&self) -> Option<i32>

Decodes Codec.INT from any numeric NBT tag.

Source

fn codec_f32(&self) -> Option<f32>

Decodes Codec.FLOAT from any numeric NBT tag.

Source

fn codec_f64(&self) -> Option<f64>

Decodes Codec.DOUBLE from any numeric NBT tag.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NbtNumeric for NbtTag

Source§

impl NbtNumeric for NbtTag<'_, '_>

Implementors§