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