Struct is_tree::visitor::Visitor

source ·
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§

source§

impl<Parent, Value> Visitor<Parent, Value>

source

pub fn new(parent: Parent, value: Value) -> Self

Creates a new visitor.

Trait Implementations§

source§

impl<Parent: Clone, Value: Clone> Clone for Visitor<Parent, Value>

source§

fn clone(&self) -> Visitor<Parent, Value>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Parent: Debug, Value: Debug> Debug for Visitor<Parent, Value>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Parent: Default, Value: Default> Default for Visitor<Parent, Value>

source§

fn default() -> Visitor<Parent, Value>

Returns the “default value” for a type. Read more
source§

impl<Parent, Value> HasPath for Visitor<Parent, Value>
where Value: HasPathSegment, Parent: HasPath,

source§

fn path(&self) -> Path

Gets the path of the type.
source§

impl<Parent, Value> HasPathSegment for Visitor<Parent, Value>
where Value: HasPathSegment,

source§

fn path_segment(&self) -> String

Gets the path segment of the type.
source§

fn is(&self, identifier: impl PartialEq<String>) -> bool

Checks if the type is identified by the given path segment.

Auto Trait Implementations§

§

impl<Parent, Value> Freeze for Visitor<Parent, Value>
where Parent: Freeze, Value: Freeze,

§

impl<Parent, Value> RefUnwindSafe for Visitor<Parent, Value>
where Parent: RefUnwindSafe, Value: RefUnwindSafe,

§

impl<Parent, Value> Send for Visitor<Parent, Value>
where Parent: Send, Value: Send,

§

impl<Parent, Value> Sync for Visitor<Parent, Value>
where Parent: Sync, Value: Sync,

§

impl<Parent, Value> Unpin for Visitor<Parent, Value>
where Parent: Unpin, Value: Unpin,

§

impl<Parent, Value> UnwindSafe for Visitor<Parent, Value>
where Parent: UnwindSafe, Value: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> HasBranchesAPI for T

source§

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

source§

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,

Iterates over the branches of a type mutably.
source§

impl<T> HasGet for T

source§

fn get_impl<T>(self, segment: impl Into<String>) -> Option<T>
where Self: HasBranches<T> + Sized, T: HasPathSegment,

Gets a branch by its path segment. It’s discouraged to use this method directly. Instead, use the get and get_mut method from the HasGetAPI trait.
source§

impl<'a, T> HasGetAPI<'a> for T

source§

fn get<T>(&'a self, segment: impl Into<String>) -> Option<T>

Gets a branch by its path segment.
source§

fn get_mut<T>(&'a mut self, segment: impl Into<String>) -> Option<T>

Gets a branch by its path segment mutably.
source§

fn branch<T>(&'a mut self, segment: impl Into<String>) -> &'a mut T

source§

impl<'a, T> HasRelative<'a> for T

source§

fn relative<K>(&'a self, path: impl IntoIterator<Item = K>) -> Option<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<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T> UnsafeHasRelative<'a> for T

source§

unsafe fn relative_mut<K>( &'a mut self, path: impl IntoIterator<Item = K>, ) -> Option<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.