Enum muse_lang::runtime::value::RootedValue
source · pub enum RootedValue {
Primitive(Primitive),
Symbol(Symbol),
Dynamic(AnyDynamicRoot),
}Expand description
A Muse virtual machine value that holds strong references.
Variants§
Primitive(Primitive)
Symbol(Symbol)
A symbol.
Dynamic(AnyDynamicRoot)
A dynamically allocated, garbage collected type.
Implementations§
source§impl RootedValue
impl RootedValue
pub const TRUE: Self = _
pub const FALSE: Self = _
pub const NIL: Self = _
pub const ZERO: Self = _
sourcepub fn downgrade(&self) -> Value
pub fn downgrade(&self) -> Value
Returns this value with weak references to any garbage collected data.
sourcepub fn dynamic<'guard, T>(
value: T,
guard: &impl AsRef<CollectionGuard<'guard>>,
) -> Selfwhere
T: DynamicValue + Trace,
pub fn dynamic<'guard, T>(
value: T,
guard: &impl AsRef<CollectionGuard<'guard>>,
) -> Selfwhere
T: DynamicValue + Trace,
Moves value into the virtual machine.
sourcepub fn as_primitive(&self) -> Option<Primitive>
pub fn as_primitive(&self) -> Option<Primitive>
Returns this value as an i64, if possible.
sourcepub fn as_symbol_ref(&self) -> Option<SymbolRef>
pub fn as_symbol_ref(&self) -> Option<SymbolRef>
Returns this value as a SymbolRef, if possible.
sourcepub fn as_any_dynamic(&self) -> Option<AnyDynamic>
pub fn as_any_dynamic(&self) -> Option<AnyDynamic>
Returns this value as an AnyDynamic, if possible.
sourcepub fn as_dynamic<T>(&self) -> Option<Dynamic<T>>where
T: DynamicValue + Trace,
pub fn as_dynamic<T>(&self) -> Option<Dynamic<T>>where
T: DynamicValue + Trace,
Returns this value as a Dynamic<T>, if this value contains a T.
sourcepub fn as_rooted<T>(&self) -> Option<Rooted<T>>where
T: DynamicValue + Trace,
pub fn as_rooted<T>(&self) -> Option<Rooted<T>>where
T: DynamicValue + Trace,
Returns this value as a Rooted<T>, if this value contains a T.
sourcepub fn as_downcast_ref<T>(&self) -> Option<&T>where
T: DynamicValue + Trace,
pub fn as_downcast_ref<T>(&self) -> Option<&T>where
T: DynamicValue + Trace,
Returns this value as a&T, if this value contains a T.
Trait Implementations§
source§impl Clone for RootedValue
impl Clone for RootedValue
source§fn clone(&self) -> RootedValue
fn clone(&self) -> RootedValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for RootedValue
impl Debug for RootedValue
source§impl Default for RootedValue
impl Default for RootedValue
source§impl From<&Symbol> for RootedValue
impl From<&Symbol> for RootedValue
source§impl From<Symbol> for RootedValue
impl From<Symbol> for RootedValue
source§impl From<bool> for RootedValue
impl From<bool> for RootedValue
source§impl From<f32> for RootedValue
impl From<f32> for RootedValue
source§impl From<f64> for RootedValue
impl From<f64> for RootedValue
source§impl From<i16> for RootedValue
impl From<i16> for RootedValue
source§impl From<i32> for RootedValue
impl From<i32> for RootedValue
source§impl From<i64> for RootedValue
impl From<i64> for RootedValue
source§impl From<i8> for RootedValue
impl From<i8> for RootedValue
source§impl From<u16> for RootedValue
impl From<u16> for RootedValue
source§impl From<u32> for RootedValue
impl From<u32> for RootedValue
source§impl From<u64> for RootedValue
impl From<u64> for RootedValue
source§impl From<u8> for RootedValue
impl From<u8> for RootedValue
source§impl PartialEq for RootedValue
impl PartialEq for RootedValue
source§impl TryFrom<i128> for RootedValue
impl TryFrom<i128> for RootedValue
source§impl TryFrom<isize> for RootedValue
impl TryFrom<isize> for RootedValue
source§impl TryFrom<u128> for RootedValue
impl TryFrom<u128> for RootedValue
Auto Trait Implementations§
impl Freeze for RootedValue
impl RefUnwindSafe for RootedValue
impl Send for RootedValue
impl Sync for RootedValue
impl Unpin for RootedValue
impl UnwindSafe for RootedValue
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
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)