Trait microkelvin::Compound [−][src]
pub trait Compound<A>: Canon { type Leaf: Canon; fn child(&self, ofs: usize) -> Child<'_, Self, A>; fn child_mut(&mut self, ofs: usize) -> ChildMut<'_, Self, A>; fn from_generic(tree: &GenericTree) -> Result<Self, CanonError>
where
Self::Leaf: Canon,
A: Canon; fn annotations(&self) -> AnnoIter<'_, Self, A>ⓘ
where
A: Annotation<Self::Leaf>, { ... } fn generic(&self) -> GenericTree
where
Self::Leaf: Canon,
A: Annotation<Self::Leaf>, { ... } }
Expand description
A type that can recursively contain itself and leaves.
Associated Types
Required methods
Returns a reference to a possible child at specified offset
Returns a mutable reference to a possible child at specified offset
fn from_generic(tree: &GenericTree) -> Result<Self, CanonError> where
Self::Leaf: Canon,
A: Canon,
fn from_generic(tree: &GenericTree) -> Result<Self, CanonError> where
Self::Leaf: Canon,
A: Canon,
Construct a specific compound tree from a generic tree
Provided methods
fn annotations(&self) -> AnnoIter<'_, Self, A>ⓘ where
A: Annotation<Self::Leaf>,
fn annotations(&self) -> AnnoIter<'_, Self, A>ⓘ where
A: Annotation<Self::Leaf>,
Provides an iterator over all sub-annotations of the compound node
fn generic(&self) -> GenericTree where
Self::Leaf: Canon,
A: Annotation<Self::Leaf>,
fn generic(&self) -> GenericTree where
Self::Leaf: Canon,
A: Annotation<Self::Leaf>,
Returns a generic version of this compound tree, erasing the specific annotation and leaf types, to provide a universal tree encoding.