#[repr(transparent)]pub struct Sequence<'arena, T> {
pub nodes: Vec<'arena, T>,
}Expand description
A sequence of AST nodes allocated in a bumpalo::Bump.
Fields§
§nodes: Vec<'arena, T>Implementations§
Source§impl<'arena, T> Sequence<'arena, T>
impl<'arena, T> Sequence<'arena, T>
pub const fn new(inner: BVec<'arena, T>) -> Self
pub fn empty(arena: &'arena Bump) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: usize) -> Option<&T>
pub fn first(&self) -> Option<&T>
pub fn last(&self) -> Option<&T>
pub fn iter(&self) -> Iter<'_, T>
pub fn as_slice(&self) -> &[T]
Trait Implementations§
Source§impl<'a, T> IntoIterator for &'a Sequence<'_, T>
impl<'a, T> IntoIterator for &'a Sequence<'_, T>
Source§impl<'arena, T> IntoIterator for Sequence<'arena, T>
impl<'arena, T> IntoIterator for Sequence<'arena, T>
Source§impl<'arena, T: Ord> Ord for Sequence<'arena, T>
impl<'arena, T: Ord> Ord for Sequence<'arena, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'arena, T: PartialOrd> PartialOrd for Sequence<'arena, T>
impl<'arena, T: PartialOrd> PartialOrd for Sequence<'arena, T>
impl<'arena, T: Eq> Eq for Sequence<'arena, T>
impl<'arena, T> StructuralPartialEq for Sequence<'arena, T>
Auto Trait Implementations§
impl<'arena, T> Freeze for Sequence<'arena, T>
impl<'arena, T> !RefUnwindSafe for Sequence<'arena, T>
impl<'arena, T> !Send for Sequence<'arena, T>
impl<'arena, T> !Sync for Sequence<'arena, T>
impl<'arena, T> Unpin for Sequence<'arena, T>
impl<'arena, T> UnsafeUnpin for Sequence<'arena, T>
impl<'arena, T> !UnwindSafe for Sequence<'arena, 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
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