pub struct HirBase {
pub id: HirId,
pub parent: Option<HirId>,
pub kind_id: u16,
pub start_byte: usize,
pub end_byte: usize,
pub kind: HirKind,
pub field_id: u16,
pub children: SmallVec<[HirId; 4]>,
}Expand description
Common metadata shared by all HIR node types. Provides identity, parent link, tree-sitter connection, and child references for tree structure.
Fields§
§id: HirId§parent: Option<HirId>§kind_id: u16§start_byte: usize§end_byte: usize§kind: HirKind§field_id: u16§children: SmallVec<[HirId; 4]>Implementations§
Source§impl HirBase
impl HirBase
Sourcepub fn child_by_field<'hir>(
&self,
unit: &CompileUnit<'hir>,
field_id: u16,
) -> Option<HirNode<'hir>>
pub fn child_by_field<'hir>( &self, unit: &CompileUnit<'hir>, field_id: u16, ) -> Option<HirNode<'hir>>
Find child with matching field ID (linear search, O(n))
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HirBase
impl RefUnwindSafe for HirBase
impl Send for HirBase
impl Sync for HirBase
impl Unpin for HirBase
impl UnwindSafe for HirBase
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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