Skip to main content

MiraManageable

Enum MiraManageable 

Source
pub enum MiraManageable {
    Value(MiraValue),
    String(String),
    Array(Box<dyn MiraArray>),
    Record(Box<dyn MiraRecord>),
    Function(Rc<dyn MiraFunction>),
    Module(Box<dyn MiraModule>),
}
Expand description

An owned value waiting to be inserted into a Runtime arena.

Variants§

§

Value(MiraValue)

A value whose payload is already inline or already belongs to this Runtime.

§

String(String)

An owned string.

§

Array(Box<dyn MiraArray>)

An owned array implementation.

§

Record(Box<dyn MiraRecord>)

An owned record implementation.

§

Function(Rc<dyn MiraFunction>)

An owned callable implementation.

§

Module(Box<dyn MiraModule>)

An owned module implementation.

Implementations§

Source§

impl MiraManageable

Source

pub fn value_type(&self) -> MiraType

Return the MiraScript type of this value.

Source§

impl MiraManageable

Source

pub fn from_array(value: impl MiraArray) -> Self

Wrap an array implementation for insertion into a Runtime.

Source

pub fn from_record(value: impl MiraRecord) -> Self

Wrap a record implementation for insertion into a Runtime.

Source

pub fn from_function(value: impl MiraFunction) -> Self

Wrap a function implementation for insertion into a Runtime.

Source

pub fn from_module(value: impl MiraModule) -> Self

Wrap a module implementation for insertion into a Runtime.

Source

pub fn map_module( name: impl Into<String>, values: IndexMap<String, MiraValue>, ) -> Self

Build a simple named module from already materialized Runtime values.

Trait Implementations§

Source§

impl From<&str> for MiraManageable

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<()> for MiraManageable

Source§

fn from(value: ()) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1> From<(T0, T1)> for MiraManageable
where T0: MiraField, T1: MiraField,

Source§

fn from(value: (T0, T1)) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1, T2> From<(T0, T1, T2)> for MiraManageable
where T0: MiraField, T1: MiraField, T2: MiraField,

Source§

fn from(value: (T0, T1, T2)) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1, T2, T3> From<(T0, T1, T2, T3)> for MiraManageable
where T0: MiraField, T1: MiraField, T2: MiraField, T3: MiraField,

Source§

fn from(value: (T0, T1, T2, T3)) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1, T2, T3, T4> From<(T0, T1, T2, T3, T4)> for MiraManageable
where T0: MiraField, T1: MiraField, T2: MiraField, T3: MiraField, T4: MiraField,

Source§

fn from(value: (T0, T1, T2, T3, T4)) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1, T2, T3, T4, T5> From<(T0, T1, T2, T3, T4, T5)> for MiraManageable
where T0: MiraField, T1: MiraField, T2: MiraField, T3: MiraField, T4: MiraField, T5: MiraField,

Source§

fn from(value: (T0, T1, T2, T3, T4, T5)) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1, T2, T3, T4, T5, T6> From<(T0, T1, T2, T3, T4, T5, T6)> for MiraManageable
where T0: MiraField, T1: MiraField, T2: MiraField, T3: MiraField, T4: MiraField, T5: MiraField, T6: MiraField,

Source§

fn from(value: (T0, T1, T2, T3, T4, T5, T6)) -> Self

Converts to this type from the input type.
Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> From<(T0, T1, T2, T3, T4, T5, T6, T7)> for MiraManageable
where T0: MiraField, T1: MiraField, T2: MiraField, T3: MiraField, T4: MiraField, T5: MiraField, T6: MiraField, T7: MiraField,

Source§

fn from(value: (T0, T1, T2, T3, T4, T5, T6, T7)) -> Self

Converts to this type from the input type.
Source§

impl<T0> From<(T0,)> for MiraManageable
where T0: MiraField,

Source§

fn from(value: (T0,)) -> Self

Converts to this type from the input type.
Source§

impl<T: MiraField> From<BTreeMap<String, T>> for MiraManageable

Source§

fn from(value: BTreeMap<String, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: MiraField> From<Box<[T]>> for MiraManageable

Source§

fn from(value: Box<[T]>) -> Self

Converts to this type from the input type.
Source§

impl<T: MiraField, S: BuildHasher + 'static> From<HashMap<String, T, S>> for MiraManageable

Source§

fn from(value: HashMap<String, T, S>) -> Self

Converts to this type from the input type.
Source§

impl<T: MiraField> From<IndexMap<String, T>> for MiraManageable

Source§

fn from(value: IndexMap<String, T>) -> Self

Converts to this type from the input type.
Source§

impl From<MiraNativeFn> for MiraManageable

Source§

fn from(value: MiraNativeFn) -> Self

Converts to this type from the input type.
Source§

impl From<String> for MiraManageable

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl<T> From<T> for MiraManageable
where T: Into<MiraValue>,

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T: MiraField> From<Vec<T>> for MiraManageable

Source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: MiraField, const N: usize> From<[T; N]> for MiraManageable

Source§

fn from(value: [T; N]) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<MiraManageable> for MiraValue

Source§

type Error = ()

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

fn try_from(value: MiraManageable) -> Result<Self, Self::Error>

Performs the conversion.

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