pub enum Tree<Data, LeafData> {
Node(TreeNode<Data, LeafData>),
Leaf(LeafData),
}Variants§
Implementations§
Source§impl<Data, LeafData> Tree<Data, LeafData>
impl<Data, LeafData> Tree<Data, LeafData>
pub fn leaf(data: LeafData) -> Self
pub fn node(data: Data, open: bool, children: Vec<Self>) -> Self
pub fn child_count(&self) -> usize
pub fn leaf_data(&self) -> Option<&LeafData>
pub fn openable(&self) -> bool
pub fn open(&mut self)
pub fn close(&mut self)
pub fn iter(&self) -> impl Iterator<Item = TreeIterItem<'_, Data, LeafData>>
pub fn iter_open( &self, ) -> impl Iterator<Item = TreeIterItem<'_, Data, LeafData>>
pub fn nth_mut(&mut self, n: usize) -> Option<&mut Self>
Trait Implementations§
impl<Data: Eq, LeafData: Eq> Eq for Tree<Data, LeafData>
impl<Data, LeafData> StructuralPartialEq for Tree<Data, LeafData>
Auto Trait Implementations§
impl<Data, LeafData> Freeze for Tree<Data, LeafData>
impl<Data, LeafData> RefUnwindSafe for Tree<Data, LeafData>where
LeafData: RefUnwindSafe,
Data: RefUnwindSafe,
impl<Data, LeafData> Send for Tree<Data, LeafData>
impl<Data, LeafData> Sync for Tree<Data, LeafData>
impl<Data, LeafData> Unpin for Tree<Data, LeafData>
impl<Data, LeafData> UnwindSafe for Tree<Data, LeafData>where
LeafData: UnwindSafe,
Data: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more