Skip to main content

Arena

Struct Arena 

Source
pub struct Arena { /* private fields */ }

Implementations§

Source§

impl Arena

Source

pub fn new() -> Self

Source

pub fn alloc(&mut self, node: SpannedNode) -> NodeRef

Source

pub fn get(&self, r: NodeRef) -> &SpannedNode

Source

pub fn is_valid(&self, r: NodeRef) -> bool

Source

pub fn node(&self, r: NodeRef) -> &Node

Source

pub fn span(&self, r: NodeRef) -> SourceSpan

Source

pub fn as_str(&self, r: NodeRef) -> Option<&str>

Source

pub fn as_map(&self, r: NodeRef) -> Option<&[(String, NodeRef)]>

Source

pub fn map_get(&self, r: NodeRef, key: &str) -> Option<NodeRef>

Source

pub fn as_list(&self, r: NodeRef) -> Option<&[NodeRef]>

Source

pub fn len(&self) -> usize

Source

pub fn map_remove(&mut self, r: NodeRef, key: &str)

Source

pub fn map_insert(&mut self, r: NodeRef, key: String, val: NodeRef)

Source

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§

Source§

impl Debug for Arena

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Arena

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.