Trait microkelvin::Compound
source · [−]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>ⓘNotable traits for AnnoIter<'a, C, A>impl<'a, C, A> Iterator for AnnoIter<'a, C, A> where
C: Compound<A>,
A: Annotation<C::Leaf> + 'a, type Item = WrappedAnnotation<'a, C, 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>ⓘNotable traits for AnnoIter<'a, C, A>impl<'a, C, A> Iterator for AnnoIter<'a, C, A> where
C: Compound<A>,
A: Annotation<C::Leaf> + 'a, type Item = WrappedAnnotation<'a, C, A>;
where
A: Annotation<Self::Leaf>,
fn annotations(&self) -> AnnoIter<'_, Self, A>ⓘNotable traits for AnnoIter<'a, C, A>impl<'a, C, A> Iterator for AnnoIter<'a, C, A> where
C: Compound<A>,
A: Annotation<C::Leaf> + 'a, type Item = WrappedAnnotation<'a, C, A>;
where
A: Annotation<Self::Leaf>,
C: Compound<A>,
A: Annotation<C::Leaf> + 'a, type Item = WrappedAnnotation<'a, C, A>;
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.