pub struct Path {
pub full_path: Fragment,
pub head: Identifier,
pub tail: Vec<Identifier>,
}
Available on crate feature
ast-models
only.Expand description
A double-colon separated path/reference to a module/function. This can be used in an import
declaration and
some other places. Paths with length of 1 are just Identifiers – Identifiers can be considered paths in some
instances.
Fields§
§full_path: Fragment
The Fragment of source code containing the full source of this path (including the double-colon separators).
head: Identifier
The first (left-most) identifier in this Path. This can also be considered the “root” of the path – the module that the following item/identifier can be found in.
tail: Vec<Identifier>
The rest of the Path, following the first separator.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more