pub enum MiraAny {
Nil,
Boolean(bool),
Number(f64),
String(String),
Array(Vec<MiraAny>),
Record(IndexMap<String, MiraAny>),
Function(MiraFunction),
Module(MiraModule),
Extern(Rc<dyn ExternObject>),
// some variants omitted
}Expand description
A value understood by the Rust VM.
Variants§
Nil
The MiraScript nil value.
Boolean(bool)
A boolean value.
Number(f64)
A double-precision numeric value.
String(String)
An owned UTF-8 string.
Array(Vec<MiraAny>)
An owned MiraScript array.
Record(IndexMap<String, MiraAny>)
An owned MiraScript record with insertion-ordered keys.
Function(MiraFunction)
A callable native or script function.
Module(MiraModule)
A native or execution-scoped module.
Extern(Rc<dyn ExternObject>)
A live, mutable Rust extern value.
Implementations§
Source§impl MiraAny
impl MiraAny
Sourcepub fn from_record<T: MiraRecord>(value: T) -> Self
pub fn from_record<T: MiraRecord>(value: T) -> Self
Wrap a Rust record in a new MiraShared allocation.
Wrap an existing shared Rust record as a live read-only view.
Sourcepub fn from_array<T: MiraArray>(value: T) -> Self
pub fn from_array<T: MiraArray>(value: T) -> Self
Wrap a Rust array in a new MiraShared allocation.
Wrap an existing shared Rust array as a live read-only view.
Sourcepub fn from_extern<T: MiraExtern>(value: T) -> Self
pub fn from_extern<T: MiraExtern>(value: T) -> Self
Wrap a Rust extern in a new MiraShared allocation.
Wrap an existing shared Rust extern as a live mutable object.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Return whether this value is initialized and safe to expose to host code.
Trait Implementations§
Source§impl From<MiraModule> for MiraAny
impl From<MiraModule> for MiraAny
Source§fn from(value: MiraModule) -> Self
fn from(value: MiraModule) -> Self
Converts to this type from the input type.
Source§impl From<MiraNativeFn> for MiraAny
impl From<MiraNativeFn> for MiraAny
Source§fn from(value: MiraNativeFn) -> Self
fn from(value: MiraNativeFn) -> Self
Converts to this type from the input type.
Source§fn from(value: MiraShared<T>) -> Self
fn from(value: MiraShared<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for MiraAny
impl !Send for MiraAny
impl !Sync for MiraAny
impl !UnwindSafe for MiraAny
impl Freeze for MiraAny
impl Unpin for MiraAny
impl UnsafeUnpin for MiraAny
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more