Root

Enum Root 

Source
pub enum Root {
    Ty(Arc<String>),
    Str(Arc<String>),
    F64(f64),
    Bool(bool),
    Avatar(Box<(Self, Self)>),
    Tup(Vec<Self>),
    Struct {
        name: Box<Self>,
        fields: Vec<Self>,
    },
    Enum {
        name: Box<Self>,
        variants: Vec<Self>,
    },
    Instance {
        class: usize,
        data: Option<Box<Self>>,
    },
    InstanceTy {
        ty: Box<Self>,
        data: Option<Box<Self>>,
    },
}
Expand description

Root knowledge structure.

Variants§

§

Ty(Arc<String>)

A type.

§

Str(Arc<String>)

A string value.

§

F64(f64)

An f64 value.

§

Bool(bool)

A boolean value.

§

Avatar(Box<(Self, Self)>)

Describes an avatar, e.g. Option<.T>, where Option is the avatar and .T is the core.

§

Tup(Vec<Self>)

Describes a tuple of variable number of items.

§

Struct

Describes a struct.

Fields

§name: Box<Self>

Name of struct.

§fields: Vec<Self>

Fields of struct.

§

Enum

Describes an enum.

Fields

§name: Box<Self>

Name of enum.

§variants: Vec<Self>

Variants of enum.

§

Instance

Instance with type reference.

Fields

§class: usize

A index referencing the type of instance.

§data: Option<Box<Self>>

Data of instance, if any.

§

InstanceTy

Instance with explicit type.

Fields

§ty: Box<Self>

The explicit type of instance.

§data: Option<Box<Self>>

Data of instance, if any.

Implementations§

Source§

impl Root

Source

pub fn ty_self() -> Root

The Self type.

Source

pub fn ty_arc() -> Root

The Arc type.

Source

pub fn ty_string() -> Root

The String type.

Source

pub fn ty_f64() -> Root

The f64 type.

Source

pub fn ty_bool() -> Root

The bool type.

Source

pub fn ty_box() -> Root

The Box type.

Source

pub fn ty_usize() -> Root

The usize type.

Source

pub fn ty_option() -> Root

The Option type.

Source

pub fn ty_vec() -> Root

The Vec type.

Trait Implementations§

Source§

impl Debug for Root

Source§

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

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

impl Display for Root

Source§

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

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

impl PartialEq for Root

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Root

Auto Trait Implementations§

§

impl Freeze for Root

§

impl RefUnwindSafe for Root

§

impl Send for Root

§

impl Sync for Root

§

impl Unpin for Root

§

impl UnwindSafe for Root

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.