Enum typst_syntax::ast::ImportItem
source · pub enum ImportItem<'a> {
Simple(Ident<'a>),
Renamed(RenamedImportItem<'a>),
}
Expand description
An imported item, potentially renamed to another identifier.
Variants§
Simple(Ident<'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 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