pub struct Arena { /* private fields */ }Expand description
Top-level arena that holds all memory pools for expressions, strings, and types.
Implementations§
Source§impl Arena
impl Arena
Sourcepub fn free_space(&mut self)
pub fn free_space(&mut self)
Frees types allocated after the last freeze, reclaiming memory for reuse.
Sourcepub fn get_str(&self, key: StrRef) -> &str
pub fn get_str(&self, key: StrRef) -> &str
Retrieves the interned string associated with the given StrRef.
Sourcepub fn str_ref(&self, key: &str) -> Option<StrRef>
pub fn str_ref(&self, key: &str) -> Option<StrRef>
If that value has already been interned, it returns the string pointer in the arena.
Sourcepub fn get_expr(&self, key: ExprRef) -> Expr
pub fn get_expr(&self, key: ExprRef) -> Expr
Retrieves the expression node associated with the given ExprRef.
Sourcepub fn get_type(&self, key: TypeRef) -> Type
pub fn get_type(&self, key: TypeRef) -> Type
Retrieves the type associated with the given TypeRef.
Sourcepub fn get_vec(&self, key: VecRef) -> &[ExprRef]
pub fn get_vec(&self, key: VecRef) -> &[ExprRef]
Returns the slice of expression references for the given VecRef.
Sourcepub fn get_rec(&self, key: RecRef) -> &[Field]
pub fn get_rec(&self, key: RecRef) -> &[Field]
Returns the slice of record fields for the given RecRef.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Arena
impl RefUnwindSafe for Arena
impl Send for Arena
impl Sync for Arena
impl Unpin for Arena
impl UnwindSafe for Arena
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