pub struct Traverse<'a, T, S> { /* private fields */ }
Expand description
Implements the traverse algorithms for an immutable reference of a Node
.
Implementations§
Source§impl<'a, T> Traverse<'a, T, Asynchronous>
impl<'a, T> Traverse<'a, T, Asynchronous>
Sourcepub fn into_sync(self) -> Traverse<'a, T, Synchronous>
pub fn into_sync(self) -> Traverse<'a, T, Synchronous>
Converts the asynchronous traverse into a synchronous one.
Source§impl<'a, T: Sync + Send + 'a> Traverse<'a, T, Asynchronous>
impl<'a, T: Sync + Send + 'a> Traverse<'a, T, Asynchronous>
Sourcepub async fn for_each<F>(self, f: F)
pub async fn for_each<F>(self, f: F)
Calls the given closure for each node in the tree rooted by self.
Sourcepub async fn map<F, R>(self, f: F) -> TraverseOwned<R, Asynchronous>
pub async fn map<F, R>(self, f: F) -> TraverseOwned<R, Asynchronous>
Builds a new tree by calling the given closure along the tree rooted by self following the pre-order traversal.
Source§impl<'a, T> Traverse<'a, T, Synchronous>
impl<'a, T> Traverse<'a, T, Synchronous>
pub fn into_async(self) -> Traverse<'a, T, Asynchronous>
Source§impl<'a, T> Traverse<'a, T, Synchronous>
impl<'a, T> Traverse<'a, T, Synchronous>
Sourcepub fn for_each<F>(self, f: F) -> Self
pub fn for_each<F>(self, f: F) -> Self
Traverses the tree rooted by self in post-order
, calling the given closure along the way.
Sourcepub fn map<F, R>(self, f: F) -> TraverseOwned<R, Synchronous>
pub fn map<F, R>(self, f: F) -> TraverseOwned<R, Synchronous>
Traverses the tree rooted by self in pre-order
, building a new tree by calling the given closure along the way.
Trait Implementations§
Source§impl<'a, T> From<Traverse<'a, T, Asynchronous>> for Traverse<'a, T, Synchronous>
impl<'a, T> From<Traverse<'a, T, Asynchronous>> for Traverse<'a, T, Synchronous>
Source§fn from(value: Traverse<'a, T, Asynchronous>) -> Self
fn from(value: Traverse<'a, T, Asynchronous>) -> Self
Converts to this type from the input type.
Source§impl<'a, T> From<Traverse<'a, T, Synchronous>> for Traverse<'a, T, Asynchronous>
impl<'a, T> From<Traverse<'a, T, Synchronous>> for Traverse<'a, T, Asynchronous>
Source§fn from(value: Traverse<'a, T, Synchronous>) -> Self
fn from(value: Traverse<'a, T, Synchronous>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, T, S> Freeze for Traverse<'a, T, S>
impl<'a, T, S> RefUnwindSafe for Traverse<'a, T, S>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, S> Send for Traverse<'a, T, S>
impl<'a, T, S> Sync for Traverse<'a, T, S>
impl<'a, T, S> Unpin for Traverse<'a, T, S>where
S: Unpin,
impl<'a, T, S> UnwindSafe for Traverse<'a, T, S>where
S: UnwindSafe,
T: RefUnwindSafe,
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