pub struct CompactAST { /* private fields */ }
Expand description
Compact AST representation for memory efficiency
Implementations§
Source§impl CompactAST
impl CompactAST
Sourcepub fn intern_string(&mut self, s: &str) -> u32
pub fn intern_string(&mut self, s: &str) -> u32
Intern a string and return its index
Sourcepub fn get_string(&self, idx: u32) -> Option<&str>
pub fn get_string(&self, idx: u32) -> Option<&str>
Get string by index
Sourcepub fn add_element(&mut self, element: CompactElement) -> u32
pub fn add_element(&mut self, element: CompactElement) -> u32
Add an element and return its index
Sourcepub fn get_element(&self, idx: u32) -> Option<&CompactElement>
pub fn get_element(&self, idx: u32) -> Option<&CompactElement>
Get element by index
Sourcepub fn memory_footprint(&self) -> usize
pub fn memory_footprint(&self) -> usize
Calculate memory footprint
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompactAST
impl RefUnwindSafe for CompactAST
impl Send for CompactAST
impl Sync for CompactAST
impl Unpin for CompactAST
impl UnwindSafe for CompactAST
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> 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