Skip to main content

Node

Enum Node 

Source
pub enum Node {
Show 17 variants Int(i64), BigInt(IntId), Unit, Symbol(Sym), Str(StrId), Local { name: Sym, index: u32, }, Builtin(Builtin), ModItem { index: u32, depth: u32, name: Sym, }, Home { leaf: HomeLeaf, depth: u32, }, App { len: u32, args: NodeId, }, List { len: u32, elems: NodeId, }, Map { len: u32, entries: NodeId, }, Block { len: u32, binds: PatId, exprs: NodeId, }, Case { len: u32, conds: PatId, exprs: NodeId, }, Abs(LambdaId), Recur(ModId), Barrier { run: Run, len: u32, },
}
Expand description

An expression: a tag and up to three u32 operands, 16 bytes. Children are ids into the same chunk; a node with many children names a run.

Variants§

§

Int(i64)

An integer that fits in i64.

§

BigInt(IntId)

Any other integer, in the chunk’s ints table.

§

Unit

§

Symbol(Sym)

A dotted symbol, stored without the dot.

§

Str(StrId)

§

Local

A resolved local; name is kept for rendering.

Fields

§name: Sym
§index: u32
§

Builtin(Builtin)

§

ModItem

A member of an enclosing module: index into its member space, past depth module terminals.

Fields

§index: u32
§depth: u32
§name: Sym
§

Home

Fields

§depth: u32
§

App

The run is the callee, then the len - 1 arguments.

Fields

§len: u32
§args: NodeId
§

List

Fields

§len: u32
§elems: NodeId
§

Map

The run is the len keys, then the len values.

Fields

§len: u32
§entries: NodeId
§

Block

len patterns from binds (Pat::None for a clause that binds nothing) and len clause expressions from exprs.

Fields

§len: u32
§binds: PatId
§exprs: NodeId
§

Case

len patterns from conds, and from exprs the len arm bodies followed by the subject.

Fields

§len: u32
§conds: PatId
§exprs: NodeId
§

Abs(LambdaId)

§

Recur(ModId)

A recur group: a nested module with items and a body.

§

Barrier

Stands before a run in debug builds.

Fields

§run: Run
§len: u32

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Node

Source§

impl Debug for Node

Source§

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

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

impl Eq for Node

Source§

impl PartialEq for Node

Source§

fn eq(&self, other: &Node) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.