pub struct IdxRange<T> { /* private fields */ }Expand description
A contiguous half-open run of indices, start .. end.
Children of an AST node, arguments of a call and parameters of a block are all stored as
runs in one flat vector, so the parent holds eight bytes instead of a Vec.
Implementations§
Source§impl<T> IdxRange<T>
impl<T> IdxRange<T>
Sourcepub const EMPTY: Self
pub const EMPTY: Self
The empty range at the start of the table.
Every table has a start, so this is valid whatever the table holds and whether or not anything has been put in it yet. It is what a node holds when the thing it points at is a list that happens to have nothing in it: a declarator with no derivations, a call with no arguments, a declaration with no attributes.
Sourcepub const fn as_usize_range(self) -> Range<usize> ⓘ
pub const fn as_usize_range(self) -> Range<usize> ⓘ
The range as a usize range, for slicing the backing vector.
Trait Implementations§
impl<T> Copy for IdxRange<T>
impl<T> Eq for IdxRange<T>
Auto Trait Implementations§
impl<T> Freeze for IdxRange<T>
impl<T> RefUnwindSafe for IdxRange<T>
impl<T> Send for IdxRange<T>
impl<T> Sync for IdxRange<T>
impl<T> Unpin for IdxRange<T>
impl<T> UnsafeUnpin for IdxRange<T>
impl<T> UnwindSafe for IdxRange<T>
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