pub enum ImportItem<'a> {
Simple(ImportItemPath<'a>),
Renamed(RenamedImportItem<'a>),
}
Expand description
An imported item, potentially renamed to another identifier.
Variants§
Simple(ImportItemPath<'a>)
A non-renamed import (the item’s name in the scope is the same as its name).
Renamed(RenamedImportItem<'a>)
A renamed import (the item was bound to a different name in the scope than the one it was defined as).
Implementations§
Source§impl<'a> ImportItem<'a>
impl<'a> ImportItem<'a>
Sourcepub fn path(self) -> ImportItemPath<'a>
pub fn path(self) -> ImportItemPath<'a>
The path to the imported item.
Sourcepub fn original_name(self) -> Ident<'a>
pub fn original_name(self) -> Ident<'a>
The original name of the imported item, at its source. This will be the equal to the bound name if the item wasn’t renamed with ‘as’.
Sourcepub fn bound_name(self) -> Ident<'a>
pub fn bound_name(self) -> Ident<'a>
The name which this import item was bound to. Corresponds to the new name, if it was renamed; otherwise, it’s just its original name.
Trait Implementations§
Source§impl<'a> Clone for ImportItem<'a>
impl<'a> Clone for ImportItem<'a>
Source§fn clone(&self) -> ImportItem<'a>
fn clone(&self) -> ImportItem<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for ImportItem<'a>
impl<'a> Debug for ImportItem<'a>
Source§impl<'a> Hash for ImportItem<'a>
impl<'a> Hash for ImportItem<'a>
impl<'a> Copy for ImportItem<'a>
Auto Trait Implementations§
impl<'a> Freeze for ImportItem<'a>
impl<'a> RefUnwindSafe for ImportItem<'a>
impl<'a> Send for ImportItem<'a>
impl<'a> Sync for ImportItem<'a>
impl<'a> Unpin for ImportItem<'a>
impl<'a> UnwindSafe for ImportItem<'a>
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> 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