Expand description
An enum that defines different possible states of a TagDataType::Master tag.
A “master” tag is a type of tag that contains other tags within it. Because these tags are dynamically sized, the TagIterator emits these tags as Master::Start and Master::End variants by default so that the entire tag does not need to be buffered into memory all at once. The Master::Full variant is a complete “master” tag that includes all child tags within it.
Variants
Start
Designates the start of a tag.
End
Designates the end of a tag.
Full(Vec<T>)
Designates a full tag. Vec<T> contains all child tags contained in this master tag.
Implementations
sourceimpl<T: Clone> Master<T>
impl<T: Clone> Master<T>
sourcepub fn get_children(self) -> Vec<T>
pub fn get_children(self) -> Vec<T>
Convenience method to pull children from a master tag.
Panics
Panics if self is not a Full variant.
Examples
use ebml_iterable_specification::Master;
let children = vec![EmptySpec::with_data(0x1253, &[1]), EmptySpec::with_data(0x1234, &[2])];
// Clone children because creating a Master consumes it
let tag = Master::Full(children.clone());
let retrieved_children = tag.get_children();
assert_eq!(retrieved_children, children);Trait Implementations
sourceimpl<T: Ord + Clone> Ord for Master<T>
impl<T: Ord + Clone> Ord for Master<T>
sourceimpl<T: PartialOrd + Clone> PartialOrd<Master<T>> for Master<T>
impl<T: PartialOrd + Clone> PartialOrd<Master<T>> for Master<T>
sourcefn partial_cmp(&self, other: &Master<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Master<T>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<T: Eq + Clone> Eq for Master<T>
impl<T: Clone> StructuralEq for Master<T>
impl<T: Clone> StructuralPartialEq for Master<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Master<T> where
T: RefUnwindSafe,
impl<T> Send for Master<T> where
T: Send,
impl<T> Sync for Master<T> where
T: Sync,
impl<T> Unpin for Master<T> where
T: Unpin,
impl<T> UnwindSafe for Master<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more