pub struct Arena { /* private fields */ }Implementations§
Source§impl Arena
impl Arena
pub fn new() -> Self
pub fn alloc(&mut self, node: SpannedNode) -> NodeRef
pub fn get(&self, r: NodeRef) -> &SpannedNode
pub fn is_valid(&self, r: NodeRef) -> bool
pub fn node(&self, r: NodeRef) -> &Node
pub fn span(&self, r: NodeRef) -> SourceSpan
pub fn as_str(&self, r: NodeRef) -> Option<&str>
pub fn as_map(&self, r: NodeRef) -> Option<&[(String, NodeRef)]>
pub fn map_get(&self, r: NodeRef, key: &str) -> Option<NodeRef>
pub fn as_list(&self, r: NodeRef) -> Option<&[NodeRef]>
pub fn len(&self) -> usize
pub fn map_remove(&mut self, r: NodeRef, key: &str)
pub fn map_insert(&mut self, r: NodeRef, key: String, val: NodeRef)
Sourcepub fn set(&mut self, r: NodeRef, node: SpannedNode)
pub fn set(&mut self, r: NodeRef, node: SpannedNode)
Overwrites the node at r with node. Used by the language-extensions
transform to install a rewritten section over the ref the model holds,
without threading a new ref back to every caller.
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 UnsafeUnpin 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