Enum NodeContent

Source
pub enum NodeContent {
Show 20 variants RecInt { bit_size: u32, signed: bool, }, RecFloat { size: u32, }, RecList, RecMap, RecEnum { key_type: RecTypeId, }, RecEnumItem { value: BigInt, }, RecStruct, RecStructMember, RecTupleMember { tid: RecTypeId, }, RecTypeInst { tid: RecTypeId, }, RecGeneric { index: u32, }, DatMap, DatTuple, DatList, DatMapAssignment, DatTupleMember, RecTuple, DatInt { repr: String, }, DatFloat { repr: String, }, DatEnum,
}
Expand description

Possible elements from recipe and data files

Values prefixed with Rec refer to recipe definition items. Values prefixed with Dat refer to content data.

Variants§

§

RecInt

Integer type

Nodes of this type are created by the compiler, to populate standard integer types such as i32, u32, etc.

Fields

§bit_size: u32
§signed: bool
§

RecFloat

Floating point type

Nodes of this type are created by the compiler, to populate standard f32 and f64 types. The stored value can be 32 or 64 for respectively f32 and f64.

Fields

§size: u32
§

RecList

Generic list type

§

RecMap

Generic map type

§

RecEnum

Recipe enumeration definition

RecEnum nodes have one RecEnumItem child node for each possible enumeration value.

Fields

§key_type: RecTypeId
§

RecEnumItem

An enumeration possible value

RecEnumItem can have one child, which can be a RecTuple or RecStruct

Fields

§value: BigInt
§

RecStruct

§

RecStructMember

Members of structures Name of the node is the member name in the structure Type of the structure member is first and unique child

§

RecTupleMember

Members of tuples Name of the node is None

Fields

§

RecTypeInst

Node designating another existing type in the tree Firstly stores the path string to the type, and then is resolved as the pointed type node Id. This node can have children, and each RecTypeInst children is a generic type argument to the parent node.

Fields

§

RecGeneric

Generic type node which may be child of RecStruct or native generic types such as RecList. index field corresponds to the index of the generic type in the parent type.

Fields

§index: u32
§

DatMap

§

DatTuple

§

DatList

§

DatMapAssignment

This node corresponds to a map or structure assignment (we can consider structures as a subset of maps from a grammar perspective). Such node have two childen, one for the name or key, and a second for the value.

§

DatTupleMember

§

RecTuple

§

DatInt

Fields

§repr: String
§

DatFloat

Fields

§repr: String
§

DatEnum

Enumeration identifier (works for boolean too) Enumeration value name stored in node name Also used for structure assignments.

Trait Implementations§

Source§

impl Clone for NodeContent

Source§

fn clone(&self) -> NodeContent

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeContent

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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
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.