pub struct Item<'hir> {
pub kind: ItemKind<'hir>,
pub span: Span,
pub id: HirId,
}Fields§
§kind: ItemKind<'hir>§span: Span§id: HirIdImplementations§
Source§impl<'hir> Item<'hir>
impl<'hir> Item<'hir>
pub fn new(kind: ItemKind<'hir>, span: Span) -> Self
pub fn new_param(name: &'hir PathDef, ty: &'hir Type<'hir>, span: Span) -> Self
pub fn as_struct_def(&self) -> Option<(Symbol, &'hir [Field<'hir>])>
pub fn as_variable_def( &self, ) -> Option<(Constness, Option<&'hir Type<'hir>>, Option<&'hir Expression<'hir>>)>
pub fn as_module(&self) -> Option<&'hir Module<'_>>
pub fn as_use(&self) -> Option<&'hir UseItem<'hir>>
pub fn get_name(&self) -> Symbol
pub const fn is_definition(&self) -> bool
Trait Implementations§
Source§impl<'hir> HirNode<'hir> for Item<'hir>
impl<'hir> HirNode<'hir> for Item<'hir>
fn get_hir_id(&self) -> HirId
fn get_hir_node_kind(&'hir self) -> HirNodeKind<'hir>
fn set_hir_id(&mut self, id: HirId)
impl<'hir> Copy for Item<'hir>
Auto Trait Implementations§
impl<'hir> Freeze for Item<'hir>
impl<'hir> !RefUnwindSafe for Item<'hir>
impl<'hir> !Send for Item<'hir>
impl<'hir> !Sync for Item<'hir>
impl<'hir> Unpin for Item<'hir>
impl<'hir> !UnwindSafe for Item<'hir>
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