#[repr(C)]pub struct UseItem<'ast> { /* private fields */ }
Expand description
A use
declaration like:
ⓘ
pub use foo::bar::*;
// `name()` -> `None`
// `use_path()` -> `foo::bar::*`
// `use_kind()` -> `Glob`
pub use foo::bar;
// `name()` -> `Some(bar)`
// `use_path()` -> `foo::bar`
// `use_kind()` -> `Single`
pub use foo::bar as baz;
// `name()` -> `Some(baz)`
// `use_path()` -> `foo::bar`
// `use_kind()` -> `Single`
There is a separate UseItem
per each path in a use
declaration.
For example, if you have use foo::{bar, baz};
there will be two UseItem
s
one for bar
and one for baz
and they will share a prefix in their
UseItem::use_path()
.
See https://doc.rust-lang.org/stable/reference/items/use-declarations.html
Implementations§
Trait Implementations§
Source§impl<'ast> ItemData<'ast> for UseItem<'ast>
impl<'ast> ItemData<'ast> for UseItem<'ast>
Source§fn id(&self) -> ItemId
fn id(&self) -> ItemId
Returns the
ItemId
of this item. This is a unique identifier used for comparison
and to request items from the MarkerContext
.Source§fn visibility(&self) -> &Visibility<'ast>
fn visibility(&self) -> &Visibility<'ast>
The
Visibility
of this item.Source§fn ident(&self) -> Option<&Ident<'ast>>
fn ident(&self) -> Option<&Ident<'ast>>
This function can return
None
if the item was generated and has no real nameAuto Trait Implementations§
impl<'ast> Freeze for UseItem<'ast>
impl<'ast> RefUnwindSafe for UseItem<'ast>
impl<'ast> !Send for UseItem<'ast>
impl<'ast> !Sync for UseItem<'ast>
impl<'ast> Unpin for UseItem<'ast>
impl<'ast> UnwindSafe for UseItem<'ast>
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