pub trait TreeLike: Sized {
type Child<'a>: TreeChild<Self>
where Self: 'a;
type RefIter<'a>: Iterator<Item = Self::Child<'a>> + TreeChildIter<'a, Self>
where Self: 'a;
// Required method
fn children(&self) -> Option<Self::RefIter<'_>>;
// Provided methods
fn dfs(&self) -> Option<DFSIter<'_, Self>> { ... }
fn bfs(&self) -> Option<BFSIter<'_, Self>> { ... }
fn bfs_par<'a>(&'a self) -> Option<ParSpliter<BFSIter<'a, Self>>>
where Self::Child<'a>: Send,
Self::RefIter<'a>: Send { ... }
fn dfs_with_close<'a, R, SG, SL, Open: FnMut(&mut SG, Self::Child<'a>) -> Result<DFSContinuation<SL>, R>, Close: FnMut(&mut SG, SL) -> Result<(), R>>(
&'a self,
state: &mut SG,
open: Open,
close: Close,
) -> Result<(), R> { ... }
fn display_nested<'a>(
&'a self,
f: &mut Formatter<'_>,
open: impl Fn(&Self::Child<'a>, &mut Indentor<'_>, &mut Formatter<'_>) -> Result<DFSContinuation<()>, Error>,
close: impl Fn(&Self::Child<'a>, &mut Formatter<'_>) -> Result,
indent: Option<Indentor<'_>>,
) -> Result { ... }
fn display_children<'a, I: Into<Self::RefIter<'a>>>(
i: I,
f: &mut Formatter<'_>,
open: impl Fn(&Self::Child<'a>, &mut Indentor<'_>, &mut Formatter<'_>) -> Result<DFSContinuation<()>, Error>,
close: impl Fn(&Self::Child<'a>, &mut Formatter<'_>) -> Result,
indent: Option<Indentor<'_>>,
) -> Result
where Self: 'a { ... }
}
Required Associated Types§
type Child<'a>: TreeChild<Self> where Self: 'a
type RefIter<'a>: Iterator<Item = Self::Child<'a>> + TreeChildIter<'a, Self> where Self: 'a
Required Methods§
Provided Methods§
fn dfs(&self) -> Option<DFSIter<'_, Self>>
fn bfs(&self) -> Option<BFSIter<'_, Self>>
fn bfs_par<'a>(&'a self) -> Option<ParSpliter<BFSIter<'a, Self>>>
Available on crate feature
rayon
only.fn dfs_with_close<'a, R, SG, SL, Open: FnMut(&mut SG, Self::Child<'a>) -> Result<DFSContinuation<SL>, R>, Close: FnMut(&mut SG, SL) -> Result<(), R>>( &'a self, state: &mut SG, open: Open, close: Close, ) -> Result<(), R>
fn display_nested<'a>( &'a self, f: &mut Formatter<'_>, open: impl Fn(&Self::Child<'a>, &mut Indentor<'_>, &mut Formatter<'_>) -> Result<DFSContinuation<()>, Error>, close: impl Fn(&Self::Child<'a>, &mut Formatter<'_>) -> Result, indent: Option<Indentor<'_>>, ) -> Result
fn display_children<'a, I: Into<Self::RefIter<'a>>>(
i: I,
f: &mut Formatter<'_>,
open: impl Fn(&Self::Child<'a>, &mut Indentor<'_>, &mut Formatter<'_>) -> Result<DFSContinuation<()>, Error>,
close: impl Fn(&Self::Child<'a>, &mut Formatter<'_>) -> Result,
indent: Option<Indentor<'_>>,
) -> Resultwhere
Self: 'a,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.