[][src]Struct nobility::bin_decode::NbtArray

pub struct NbtArray<'a, T> { /* fields omitted */ }

Common representation for TAG_Int_Array, TAG_Long_Array, and TAG_List with elements of fixed size (Byte, Short, Int, Long, Float, Double).

Notes

It's not possible to implement Index on this type, because it can't return a reference to the elements. This means that array[i] doesn't work, and NbtArray::get needs to be used instead.

Implementations

impl<'a, T> NbtArray<'a, T> where
    T: NbtPrimitive, 
[src]

pub fn len(&self) -> usize[src]

Returns the number of elements in the array.

pub fn is_empty(&self) -> bool[src]

Returns true if there are no elements in the array.

pub fn get(&self, index: usize) -> Option<T>[src]

Returns an element at the index if it's in the range 0..len(), or None.

pub fn to_vec(&self) -> Vec<T>[src]

Creates a Vec of the contents of this array.

pub fn iter(&self) -> NbtArrayIter<'a, T>

Notable traits for NbtArrayIter<'a, T>

impl<'a, T> Iterator for NbtArrayIter<'a, T> where
    T: NbtPrimitive, 
type Item = T;
[src]

Returns an iterator over the elements of the array.

Trait Implementations

impl<'a, T: Clone> Clone for NbtArray<'a, T>[src]

impl<'a, T: Copy> Copy for NbtArray<'a, T>[src]

impl<'a, T> Debug for NbtArray<'a, T> where
    T: NbtPrimitive, 
[src]

impl<'a, T> PartialEq<NbtArray<'a, T>> for NbtArray<'a, T> where
    T: NbtPrimitive + PartialEq
[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for NbtArray<'a, T> where
    T: RefUnwindSafe
[src]

impl<'a, T> Send for NbtArray<'a, T> where
    T: Send
[src]

impl<'a, T> Sync for NbtArray<'a, T> where
    T: Sync
[src]

impl<'a, T> Unpin for NbtArray<'a, T> where
    T: Unpin
[src]

impl<'a, T> UnwindSafe for NbtArray<'a, T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.