pub struct Visitor<Parent, Current> {
pub parent: Parent,
pub current: Current,
}Expand description
Generic visitor type.
Fields§
§parent: ParentVisitor’s parent.
current: CurrentCurrently visited.
Implementations§
Source§impl Visitor<(), Library>
impl Visitor<(), Library>
pub fn root_module_visitor(&self) -> ModuleVisitor
Source§impl Visitor<ModuleParent, Module>
impl Visitor<ModuleParent, Module>
Sourcepub fn parent_library(&self) -> &Library
pub fn parent_library(&self) -> &Library
Returns the parent library.
Sourcepub fn parent_module(&self) -> Option<&ModuleVisitor>
pub fn parent_module(&self) -> Option<&ModuleVisitor>
Get the parent module.
Source§impl Visitor<ModuleParent, Module>
impl Visitor<ModuleParent, Module>
pub fn find_absolute_path(&self, relative_path: &Path) -> Option<Path>
Source§impl Visitor<Visitor<ModuleParent, Module>, Enumeration>
impl Visitor<Visitor<ModuleParent, Module>, Enumeration>
Sourcepub fn parent_module(&self) -> &ModuleVisitor
pub fn parent_module(&self) -> &ModuleVisitor
Get the parent module.
Source§impl Visitor<Visitor<ModuleParent, Module>, Structure>
impl Visitor<Visitor<ModuleParent, Module>, Structure>
Sourcepub fn parent_module(&self) -> &ModuleVisitor
pub fn parent_module(&self) -> &ModuleVisitor
Get the parent module.
Source§impl Visitor<Visitor<ModuleParent, Module>, Import>
impl Visitor<Visitor<ModuleParent, Module>, Import>
Sourcepub fn parent_library(&self) -> &Library
pub fn parent_library(&self) -> &Library
Returns the parent library.
pub fn find_absolute_path(&self) -> Option<Path>
Trait Implementations§
Source§impl<Parent, Current> AsMut<Current> for Visitor<Parent, Current>
impl<Parent, Current> AsMut<Current> for Visitor<Parent, Current>
Source§fn as_mut(&mut self) -> &mut Current
fn as_mut(&mut self) -> &mut Current
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<Parent, Current> BorrowMut<Current> for Visitor<Parent, Current>
impl<Parent, Current> BorrowMut<Current> for Visitor<Parent, Current>
Source§fn borrow_mut(&mut self) -> &mut Current
fn borrow_mut(&mut self) -> &mut Current
Mutably borrows from an owned value. Read more
Source§impl From<&Visitor<Visitor<ModuleParent, Module>, Module>> for ModuleVisitor
impl From<&Visitor<Visitor<ModuleParent, Module>, Module>> for ModuleVisitor
Source§impl Transform<Visitor<(), Library>, Library> for RelativePathToAbsolutePath
impl Transform<Visitor<(), Library>, Library> for RelativePathToAbsolutePath
fn transform(&self, data: &LibraryVisitor) -> Library
Source§impl Transform<Visitor<(), Library>, Library> for ReplaceCrateAlias
impl Transform<Visitor<(), Library>, Library> for ReplaceCrateAlias
fn transform(&self, data: &LibraryVisitor) -> Library
Source§impl Transform<Visitor<ModuleParent, Module>, Module> for RelativePathToAbsolutePath
impl Transform<Visitor<ModuleParent, Module>, Module> for RelativePathToAbsolutePath
fn transform(&self, data: &ModuleVisitor) -> Module
Source§impl Transform<Visitor<ModuleParent, Module>, Module> for ReplaceCrateAlias
impl Transform<Visitor<ModuleParent, Module>, Module> for ReplaceCrateAlias
fn transform(&self, data: &ModuleVisitor) -> Module
Source§impl Transform<Visitor<Visitor<ModuleParent, Module>, Function>, Function> for RelativePathToAbsolutePath
impl Transform<Visitor<Visitor<ModuleParent, Module>, Function>, Function> for RelativePathToAbsolutePath
fn transform(&self, data: &FunctionVisitor) -> Function
Source§impl Transform<Visitor<Visitor<ModuleParent, Module>, Import>, Import> for RelativePathToAbsolutePath
impl Transform<Visitor<Visitor<ModuleParent, Module>, Import>, Import> for RelativePathToAbsolutePath
fn transform(&self, data: &ImportVisitor) -> Import
Source§impl Transform<Visitor<Visitor<ModuleParent, Module>, Import>, Import> for ReplaceCrateAlias
impl Transform<Visitor<Visitor<ModuleParent, Module>, Import>, Import> for ReplaceCrateAlias
fn transform(&self, data: &ImportVisitor) -> Import
Auto Trait Implementations§
impl<Parent, Current> Freeze for Visitor<Parent, Current>
impl<Parent, Current> RefUnwindSafe for Visitor<Parent, Current>where
Parent: RefUnwindSafe,
Current: RefUnwindSafe,
impl<Parent, Current> Send for Visitor<Parent, Current>
impl<Parent, Current> Sync for Visitor<Parent, Current>
impl<Parent, Current> Unpin for Visitor<Parent, Current>
impl<Parent, Current> UnwindSafe for Visitor<Parent, Current>where
Parent: UnwindSafe,
Current: 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: Sized + HasBranches<T>,
fn branches_impl2<T>(self) -> impl Iterator<Item = T>where
Self: Sized + HasBranches<T>,
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: Sized + KnowsVisitor<VisitorMut = Self> + UnsafeClone + HasRootMut + HasParentMut + HasPathSegment,
&'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: Sized + KnowsVisitor<VisitorMut = Self> + UnsafeClone + HasRootMut + HasParentMut + HasPathSegment,
&'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.