pub trait ItemData<'ast>:
Debug
+ EmissionNode<'ast>
+ HasSpan<'ast>
+ HasNodeId
+ Sealed {
// Required methods
fn id(&self) -> ItemId;
fn visibility(&self) -> &Visibility<'ast>;
fn ident(&self) -> Option<&Ident<'ast>>;
fn as_item(&'ast self) -> ItemKind<'ast>;
fn attrs(&self);
}
Expand description
This trait combines methods, which are common between all items.
This trait is only meant to be implemented inside this crate. The Sealed
super trait prevents external implementations.
Required Methods§
Sourcefn 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
.
Sourcefn visibility(&self) -> &Visibility<'ast>
fn visibility(&self) -> &Visibility<'ast>
The Visibility
of this item.
Sourcefn 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 name