[−][src]Struct nobility::bin_decode::NbtArray
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]
T: NbtPrimitive,
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]
Notable traits for NbtArrayIter<'a, T>
impl<'a, T> Iterator for NbtArrayIter<'a, T> where
T: NbtPrimitive, type Item = T;
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]
T: NbtPrimitive,
impl<'a, T> PartialEq<NbtArray<'a, T>> for NbtArray<'a, T> where
T: NbtPrimitive + PartialEq,
[src]
T: NbtPrimitive + PartialEq,
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for NbtArray<'a, T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<'a, T> Send for NbtArray<'a, T> where
T: Send,
[src]
T: Send,
impl<'a, T> Sync for NbtArray<'a, T> where
T: Sync,
[src]
T: Sync,
impl<'a, T> Unpin for NbtArray<'a, T> where
T: Unpin,
[src]
T: Unpin,
impl<'a, T> UnwindSafe for NbtArray<'a, T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,