ValueOwn

Enum ValueOwn 

Source
pub enum ValueOwn<O: ByteOrder> {
Show 13 variants End(()), Byte(i8), Short(I16<O>), Int(I32<O>), Long(I64<O>), Float(F32<O>), Double(F64<O>), ByteArray(VecOwn<i8>), String(StringOwn), List(ListOwn<O>), Compound(CompoundOwn<O>), IntArray(VecOwn<I32<O>>), LongArray(VecOwn<I64<O>>),
}

Variants§

§

End(())

§

Byte(i8)

§

Short(I16<O>)

§

Int(I32<O>)

§

Long(I64<O>)

§

Float(F32<O>)

§

Double(F64<O>)

§

ByteArray(VecOwn<i8>)

§

String(StringOwn)

§

List(ListOwn<O>)

§

Compound(CompoundOwn<O>)

§

IntArray(VecOwn<I32<O>>)

§

LongArray(VecOwn<I64<O>>)

Implementations§

Source§

impl<O: ByteOrder> ValueOwn<O>

Source

pub fn tag_id(&self) -> TagID

Source

pub fn is_<T: NBT>(&self) -> bool

Source

pub fn get<'a>(&'a self, index: impl Index) -> Option<RefValue<'a, O>>

Source

pub fn get_<'a, T: GenericNBT>( &'a self, index: impl Index, ) -> Option<T::TypeRef<'a, MutableConfig<O>>>

Source

pub fn get_mut<'a>(&'a mut self, index: impl Index) -> Option<MutValue<'a, O>>

Source

pub fn get_mut_<'a, T: GenericNBT>( &'a mut self, index: impl Index, ) -> Option<T::TypeMut<'a, MutableConfig<O>>>

Source

pub fn to_ref<'a>(&'a self) -> RefValue<'a, O>

Source

pub fn to_mut<'a>(&'a mut self) -> MutValue<'a, O>

Trait Implementations§

Source§

impl<O: ByteOrder> Default for ValueOwn<O>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<O: ByteOrder> From<()> for ValueOwn<O>

Source§

fn from(value: ()) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<CompoundOwn<O>> for ValueOwn<O>

Source§

fn from(value: CompoundOwn<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<F32<O>> for ValueOwn<O>

Source§

fn from(value: F32<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<F64<O>> for ValueOwn<O>

Source§

fn from(value: F64<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<I16<O>> for ValueOwn<O>

Source§

fn from(value: I16<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<I32<O>> for ValueOwn<O>

Source§

fn from(value: I32<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<I64<O>> for ValueOwn<O>

Source§

fn from(value: I64<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<ListOwn<O>> for ValueOwn<O>

Source§

fn from(value: ListOwn<O>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder, T: NBT> From<TypedListOwn<O, T>> for ValueOwn<O>

Source§

fn from(value: TypedListOwn<O, T>) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> From<i8> for ValueOwn<O>

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl<O: ByteOrder> Writable for ValueOwn<O>

Source§

fn write_to_vec<TARGET: ByteOrder>(&self) -> Vec<u8>

Source§

fn write_to_writer<TARGET: ByteOrder>(&self, writer: impl Write) -> Result<()>

Auto Trait Implementations§

§

impl<O> Freeze for ValueOwn<O>

§

impl<O> RefUnwindSafe for ValueOwn<O>
where O: RefUnwindSafe,

§

impl<O> Send for ValueOwn<O>

§

impl<O> Sync for ValueOwn<O>

§

impl<O> Unpin for ValueOwn<O>
where O: Unpin,

§

impl<O> UnwindSafe for ValueOwn<O>
where O: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.