[][src]Enum nobility::bin_decode::List

#[non_exhaustive]pub enum List<'a> {
    Byte(&'a [u8]),
    Short(ShortList<'a>),
    Int(IntList<'a>),
    Long(LongList<'a>),
    Float(FloatList<'a>),
    Double(DoubleList<'a>),
    ByteArray(ByteArrayList<'a>),
    String(StringList<'a>),
    Compound(CompoundList<'a>),
    List(ListList<'a>),
    IntArray(IntArrayList<'a>),
    LongArray(LongArrayList<'a>),
}

An enum that represents all possible list types.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Byte(&'a [u8])
Short(ShortList<'a>)
Int(IntList<'a>)
Long(LongList<'a>)
Float(FloatList<'a>)
Double(DoubleList<'a>)
ByteArray(ByteArrayList<'a>)
String(StringList<'a>)
Compound(CompoundList<'a>)
List(ListList<'a>)
IntArray(IntArrayList<'a>)
LongArray(LongArrayList<'a>)

Implementations

impl<'a> List<'a>[src]

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

Returns the number of elements in the list.

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

Returns true if there are no elements in the list.

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

Allows the list to be indexed without creating a case for each possible list type. The return value is wrapped in a Tag.

Notes

CompoundList and ListList will both result in a clone being performed.

pub fn iter(&self) -> ListIter<'_>

Notable traits for ListIter<'a>

impl<'a> Iterator for ListIter<'a> type Item = Tag<'a>;
[src]

Returns an iterator over the elements of the list, yielding a Tag.

Trait Implementations

impl<'a> Clone for List<'a>[src]

impl<'a> Debug for List<'a>[src]

impl<'a> PartialEq<List<'a>> for List<'a>[src]

impl<'a> StructuralPartialEq for List<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for List<'a>[src]

impl<'a> Send for List<'a>[src]

impl<'a> Sync for List<'a>[src]

impl<'a> Unpin for List<'a>[src]

impl<'a> UnwindSafe for List<'a>[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.