pub struct Visitor<Parent, Value> {
pub parent: Parent,
pub value: Value,
}
Expand description
A visitor for tree traversal.
Fields§
§parent: Parent
The parent of the visitor.
value: Value
The value of the visitor.
Implementations§
Trait Implementations§
Source§impl<'a, Parent, Value, T> HasBranches<T> for &'a Visitor<Parent, Value>where
Visitor<Parent, Value>: UnsafeClone,
T: From<Visitor<Parent, Value>> + 'a,
&'a T: HasBranches<T>,
impl<'a, Parent, Value, T> HasBranches<T> for &'a Visitor<Parent, Value>where
Visitor<Parent, Value>: UnsafeClone,
T: From<Visitor<Parent, Value>> + 'a,
&'a T: HasBranches<T>,
Source§fn branches_impl(self) -> impl Iterator<Item = T>
fn branches_impl(self) -> impl Iterator<Item = T>
This is the method that should be implemented to provide a way to iterate over the branches of a type.
It’s discouraged to use this method directly. Instead, use the
branches
method from the HasBranchesAPIV2
trait.Source§impl<Parent, Value> HasParentMut for Visitor<Parent, Value>
impl<Parent, Value> HasParentMut for Visitor<Parent, Value>
Source§unsafe fn parent_mut(&mut self) -> Option<Self::VisitorMut>
unsafe fn parent_mut(&mut self) -> Option<Self::VisitorMut>
Gets the parent of the object.
Source§impl<Parent, Value> HasPath for Visitor<Parent, Value>where
Value: HasPathSegment,
Parent: HasPath,
impl<Parent, Value> HasPath for Visitor<Parent, Value>where
Value: HasPathSegment,
Parent: HasPath,
Source§impl<Parent, Value> HasPathSegment for Visitor<Parent, Value>where
Value: HasPathSegment,
impl<Parent, Value> HasPathSegment for Visitor<Parent, Value>where
Value: HasPathSegment,
Source§impl<Parent, Value> HasRootMut for Visitor<Parent, Value>
impl<Parent, Value> HasRootMut for Visitor<Parent, Value>
Source§unsafe fn root_mut(&mut self) -> Self::VisitorMut
unsafe fn root_mut(&mut self) -> Self::VisitorMut
Gets the root of the object.
Source§impl<Parent, Value> KnowsVisitor for Visitor<Parent, Value>where
Parent: KnowsVisitor,
impl<Parent, Value> KnowsVisitor for Visitor<Parent, Value>where
Parent: KnowsVisitor,
Source§type Visitor = <Parent as KnowsVisitor>::Visitor
type Visitor = <Parent as KnowsVisitor>::Visitor
The visitor type.
type VisitorMut = <Parent as KnowsVisitor>::VisitorMut
Source§impl<'a, Parent, Value> UnsafeClone for Visitor<Parent, &'a Value>where
Parent: Clone,
impl<'a, Parent, Value> UnsafeClone for Visitor<Parent, &'a Value>where
Parent: Clone,
Source§unsafe fn unsafe_clone(&self) -> Self
unsafe fn unsafe_clone(&self) -> Self
Clones the object.
Source§impl<Parent, Value> UnsafeClone for Visitor<Parent, &mut Value>where
Parent: Clone,
impl<Parent, Value> UnsafeClone for Visitor<Parent, &mut Value>where
Parent: Clone,
Source§unsafe fn unsafe_clone(&self) -> Self
unsafe fn unsafe_clone(&self) -> Self
Clones the object.
Auto Trait Implementations§
impl<Parent, Value> Freeze for Visitor<Parent, Value>
impl<Parent, Value> RefUnwindSafe for Visitor<Parent, Value>where
Parent: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Parent, Value> Send for Visitor<Parent, Value>
impl<Parent, Value> Sync for Visitor<Parent, Value>
impl<Parent, Value> Unpin for Visitor<Parent, Value>
impl<Parent, Value> UnwindSafe for Visitor<Parent, Value>where
Parent: UnwindSafe,
Value: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> HasBranchesAPI for T
impl<T> HasBranchesAPI for T
Source§fn branches_impl2<T>(self) -> impl Iterator<Item = T>where
Self: HasBranches<T> + Sized,
fn branches_impl2<T>(self) -> impl Iterator<Item = T>where
Self: HasBranches<T> + Sized,
This is used internally. Should use
branches
instead.Source§impl<'a, T> HasBranchesAPIV2<'a> for T
impl<'a, T> HasBranchesAPIV2<'a> for T
Source§fn branches<T>(&'a self) -> impl Iterator<Item = T>where
&'a Self: HasBranches<T>,
T: 'a,
fn branches<T>(&'a self) -> impl Iterator<Item = T>where
&'a Self: HasBranches<T>,
T: 'a,
Iterates over the branches of a type.
Source§fn branches_mut<T>(&'a mut self) -> impl Iterator<Item = T>where
&'a mut Self: HasBranches<T>,
T: 'a,
fn branches_mut<T>(&'a mut self) -> impl Iterator<Item = T>where
&'a mut Self: HasBranches<T>,
T: 'a,
Iterates over the branches of a type mutably.
fn all_branches<T>(&'a self) -> impl Iterator<Item = T>
fn all_branches_mut<T>(&'a mut self) -> impl Iterator<Item = T>
Source§impl<T> HasGet for T
impl<T> HasGet for T
Source§impl<'a, T> HasGetAPI<'a> for T
impl<'a, T> HasGetAPI<'a> for T
Source§impl<'a, T> HasRelative<'a> for T
impl<'a, T> HasRelative<'a> for T
Source§fn relative<K>(&'a self, path: impl IntoIterator<Item = K>) -> Option<Self>where
K: Into<String>,
Self: KnowsVisitor<Visitor = Self> + Clone + HasRoot + HasParent + HasPathSegment,
&'a Self: HasBranches<Self>,
fn relative<K>(&'a self, path: impl IntoIterator<Item = K>) -> Option<Self>where
K: Into<String>,
Self: KnowsVisitor<Visitor = Self> + Clone + HasRoot + HasParent + HasPathSegment,
&'a Self: HasBranches<Self>,
Gets a relative path.
“self”, “root”, and “super” are reserved path segments.
“self” is the current object, “root” is the root object, and “super” is the parent object.
Source§impl<'a, T> HasRelativeMut<'a> for T
impl<'a, T> HasRelativeMut<'a> for T
Source§unsafe fn relative_mut<K>(
&'a mut self,
path: impl IntoIterator<Item = K>,
) -> Option<Self>where
K: Into<String>,
Self: KnowsVisitor<VisitorMut = Self> + UnsafeClone + HasRootMut + HasParentMut + HasPathSegment + Sized,
&'a mut Self: HasBranches<Self>,
unsafe fn relative_mut<K>(
&'a mut self,
path: impl IntoIterator<Item = K>,
) -> Option<Self>where
K: Into<String>,
Self: KnowsVisitor<VisitorMut = Self> + UnsafeClone + HasRootMut + HasParentMut + HasPathSegment + Sized,
&'a mut Self: HasBranches<Self>,
Gets a relative path mutably.
“self”, “root”, and “super” are reserved path segments.
“self” is the current object, “root” is the root object, and “super” is the parent object.