[−][src]Struct nobility::bin_decode::Compound
Represents TAG_Compound, a list of key/value pairs. The order of the entries is the same that they appear in the file, although this usually is not significant.
Example
if let Some(entry) = compound.find_first_key("Health") { if let Some(health) = entry.value().to_i64() { println!("Player has {} health", health); } }
Implementations
impl<'a> Compound<'a>
[src]
pub fn len(&self) -> usize
[src]
Returns the number of entries.
pub fn is_empty(&self) -> bool
[src]
Returns true if there are no entries.
pub fn into_vec(self) -> Vec<Entry<'a>>
[src]
Converts into a Vec of key/value pairs.
pub fn find_first_key(&self, key: &str) -> Option<&Entry<'a>>
[src]
Searches for the first key that matches the input, and returns it if it exists.
pub fn iter(&self) -> SliceIter<'_, Entry<'a>>
[src]
Returns an iterator over the entries.
pub fn entries(&self) -> &[Entry<'a>]
[src]
Trait Implementations
impl<'a> Clone for Compound<'a>
[src]
impl<'a> Debug for Compound<'a>
[src]
impl<'a> Index<usize> for Compound<'a>
[src]
type Output = Entry<'a>
The returned type after indexing.
pub fn index(&self, index: usize) -> &Self::Output
[src]
impl<'a> PartialEq<Compound<'a>> for Compound<'a>
[src]
pub fn eq(&self, other: &Compound<'a>) -> bool
[src]
pub fn ne(&self, other: &Compound<'a>) -> bool
[src]
impl<'a> StructuralPartialEq for Compound<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Compound<'a>
[src]
impl<'a> Send for Compound<'a>
[src]
impl<'a> Sync for Compound<'a>
[src]
impl<'a> Unpin for Compound<'a>
[src]
impl<'a> UnwindSafe for Compound<'a>
[src]
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>,