Struct muse_lang::runtime::value::AnyDynamic
source · pub struct AnyDynamic(/* private fields */);Expand description
A weak reference to a Rooted<T>.
Implementations§
source§impl AnyDynamic
impl AnyDynamic
sourcepub fn new<'guard, T>(
value: T,
guard: &impl AsRef<CollectionGuard<'guard>>,
) -> Selfwhere
T: DynamicValue + Trace,
pub fn new<'guard, T>(
value: T,
guard: &impl AsRef<CollectionGuard<'guard>>,
) -> Selfwhere
T: DynamicValue + Trace,
Returns value as a garbage collected value that can be used in Muse.
sourcepub fn upgrade(&self, guard: &CollectionGuard<'_>) -> Option<AnyDynamicRoot>
pub fn upgrade(&self, guard: &CollectionGuard<'_>) -> Option<AnyDynamicRoot>
Returns this dynamic upgraded to a root reference.
sourcepub fn as_dynamic<T>(&self) -> Dynamic<T>where
T: DynamicValue + Trace,
pub fn as_dynamic<T>(&self) -> Dynamic<T>where
T: DynamicValue + Trace,
Upgrades this reference to a Dynamic<T>.
This function does no type checking. If T is the incorrect type,
trying to access the underyling data will return None/an error.
sourcepub fn as_rooted<T>(&self, guard: &CollectionGuard<'_>) -> Option<Rooted<T>>where
T: DynamicValue + Trace,
pub fn as_rooted<T>(&self, guard: &CollectionGuard<'_>) -> Option<Rooted<T>>where
T: DynamicValue + Trace,
Tries to upgrade this reference to a Rooted<T>.
This function can return None if:
Tis not the correct type.- The value has been garbage collected.
sourcepub fn downcast_ref<'guard, T>(
&self,
guard: &'guard CollectionGuard<'_>,
) -> Option<&'guard T>where
T: DynamicValue + Trace,
pub fn downcast_ref<'guard, T>(
&self,
guard: &'guard CollectionGuard<'_>,
) -> Option<&'guard T>where
T: DynamicValue + Trace,
Tries to load a reference to this reference’s underlying data.
This function can return None if:
Tis not the correct type.- The value has been garbage collected.
sourcepub fn deep_clone(&self, guard: &CollectionGuard<'_>) -> Option<AnyDynamic>
pub fn deep_clone(&self, guard: &CollectionGuard<'_>) -> Option<AnyDynamic>
Invokes deep_clone on the underlying type’s TypeVtable.
sourcepub fn call(
&self,
vm: &mut VmContext<'_, '_>,
arity: impl Into<Arity>,
) -> Result<Value, Fault>
pub fn call( &self, vm: &mut VmContext<'_, '_>, arity: impl Into<Arity>, ) -> Result<Value, Fault>
Invokes call on the underlying type’s TypeVtable.
sourcepub fn invoke(
&self,
vm: &mut VmContext<'_, '_>,
symbol: &SymbolRef,
arity: impl Into<Arity>,
) -> Result<Value, Fault>
pub fn invoke( &self, vm: &mut VmContext<'_, '_>, symbol: &SymbolRef, arity: impl Into<Arity>, ) -> Result<Value, Fault>
Invokes invoke on the underlying type’s TypeVtable.
sourcepub fn add(
&self,
vm: &mut VmContext<'_, '_>,
rhs: &Value,
) -> Result<Value, Fault>
pub fn add( &self, vm: &mut VmContext<'_, '_>, rhs: &Value, ) -> Result<Value, Fault>
Invokes add on the underlying type’s TypeVtable.
sourcepub fn add_right(
&self,
vm: &mut VmContext<'_, '_>,
lhs: &Value,
) -> Result<Value, Fault>
pub fn add_right( &self, vm: &mut VmContext<'_, '_>, lhs: &Value, ) -> Result<Value, Fault>
Invokes add_right on the underlying type’s TypeVtable.
sourcepub fn sub(
&self,
vm: &mut VmContext<'_, '_>,
rhs: &Value,
) -> Result<Value, Fault>
pub fn sub( &self, vm: &mut VmContext<'_, '_>, rhs: &Value, ) -> Result<Value, Fault>
Invokes sub on the underlying type’s TypeVtable.
sourcepub fn sub_right(
&self,
vm: &mut VmContext<'_, '_>,
lhs: &Value,
) -> Result<Value, Fault>
pub fn sub_right( &self, vm: &mut VmContext<'_, '_>, lhs: &Value, ) -> Result<Value, Fault>
Invokes sub_right on the underlying type’s TypeVtable.
sourcepub fn mul(
&self,
vm: &mut VmContext<'_, '_>,
rhs: &Value,
) -> Result<Value, Fault>
pub fn mul( &self, vm: &mut VmContext<'_, '_>, rhs: &Value, ) -> Result<Value, Fault>
Invokes mul on the underlying type’s TypeVtable.
sourcepub fn mul_right(
&self,
vm: &mut VmContext<'_, '_>,
lhs: &Value,
) -> Result<Value, Fault>
pub fn mul_right( &self, vm: &mut VmContext<'_, '_>, lhs: &Value, ) -> Result<Value, Fault>
Invokes mul_right on the underlying type’s TypeVtable.
sourcepub fn div(
&self,
vm: &mut VmContext<'_, '_>,
rhs: &Value,
) -> Result<Value, Fault>
pub fn div( &self, vm: &mut VmContext<'_, '_>, rhs: &Value, ) -> Result<Value, Fault>
Invokes div on the underlying type’s TypeVtable.
sourcepub fn div_right(
&self,
vm: &mut VmContext<'_, '_>,
lhs: &Value,
) -> Result<Value, Fault>
pub fn div_right( &self, vm: &mut VmContext<'_, '_>, lhs: &Value, ) -> Result<Value, Fault>
Invokes div_right on the underlying type’s TypeVtable.
sourcepub fn rem(
&self,
vm: &mut VmContext<'_, '_>,
rhs: &Value,
) -> Result<Value, Fault>
pub fn rem( &self, vm: &mut VmContext<'_, '_>, rhs: &Value, ) -> Result<Value, Fault>
Invokes rem on the underlying type’s TypeVtable.
sourcepub fn rem_right(
&self,
vm: &mut VmContext<'_, '_>,
lhs: &Value,
) -> Result<Value, Fault>
pub fn rem_right( &self, vm: &mut VmContext<'_, '_>, lhs: &Value, ) -> Result<Value, Fault>
Invokes rem_right on the underlying type’s TypeVtable.
sourcepub fn idiv(
&self,
vm: &mut VmContext<'_, '_>,
rhs: &Value,
) -> Result<Value, Fault>
pub fn idiv( &self, vm: &mut VmContext<'_, '_>, rhs: &Value, ) -> Result<Value, Fault>
Invokes idiv on the underlying type’s TypeVtable.
sourcepub fn idiv_right(
&self,
vm: &mut VmContext<'_, '_>,
lhs: &Value,
) -> Result<Value, Fault>
pub fn idiv_right( &self, vm: &mut VmContext<'_, '_>, lhs: &Value, ) -> Result<Value, Fault>
Invokes idiv_right on the underlying type’s TypeVtable.
sourcepub fn hash(&self, vm: &mut VmContext<'_, '_>, hasher: &mut ValueHasher)
pub fn hash(&self, vm: &mut VmContext<'_, '_>, hasher: &mut ValueHasher)
Invokes hash on the underlying type’s TypeVtable.
sourcepub fn bitwise_not(&self, vm: &mut VmContext<'_, '_>) -> Result<Value, Fault>
pub fn bitwise_not(&self, vm: &mut VmContext<'_, '_>) -> Result<Value, Fault>
Invokes bitwise_not on the underlying type’s TypeVtable.
sourcepub fn bitwise_and(
&self,
vm: &mut VmContext<'_, '_>,
other: &Value,
) -> Result<Value, Fault>
pub fn bitwise_and( &self, vm: &mut VmContext<'_, '_>, other: &Value, ) -> Result<Value, Fault>
Invokes bitwise_and on the underlying type’s TypeVtable.
sourcepub fn bitwise_or(
&self,
vm: &mut VmContext<'_, '_>,
other: &Value,
) -> Result<Value, Fault>
pub fn bitwise_or( &self, vm: &mut VmContext<'_, '_>, other: &Value, ) -> Result<Value, Fault>
Invokes bitwise_or on the underlying type’s TypeVtable.
sourcepub fn bitwise_xor(
&self,
vm: &mut VmContext<'_, '_>,
other: &Value,
) -> Result<Value, Fault>
pub fn bitwise_xor( &self, vm: &mut VmContext<'_, '_>, other: &Value, ) -> Result<Value, Fault>
Invokes bitwise_xor on the underlying type’s TypeVtable.
sourcepub fn shift_left(
&self,
vm: &mut VmContext<'_, '_>,
amount: &Value,
) -> Result<Value, Fault>
pub fn shift_left( &self, vm: &mut VmContext<'_, '_>, amount: &Value, ) -> Result<Value, Fault>
Invokes shift_left on the underlying type’s TypeVtable.
sourcepub fn shift_right(
&self,
vm: &mut VmContext<'_, '_>,
amount: &Value,
) -> Result<Value, Fault>
pub fn shift_right( &self, vm: &mut VmContext<'_, '_>, amount: &Value, ) -> Result<Value, Fault>
Invokes shift_right on the underlying type’s TypeVtable.
sourcepub fn negate(&self, vm: &mut VmContext<'_, '_>) -> Result<Value, Fault>
pub fn negate(&self, vm: &mut VmContext<'_, '_>) -> Result<Value, Fault>
Invokes negate on the underlying type’s TypeVtable.
sourcepub fn to_string(&self, vm: &mut VmContext<'_, '_>) -> Result<SymbolRef, Fault>
pub fn to_string(&self, vm: &mut VmContext<'_, '_>) -> Result<SymbolRef, Fault>
Invokes to_string on the underlying type’s TypeVtable.
sourcepub fn truthy(&self, vm: &mut VmContext<'_, '_>) -> bool
pub fn truthy(&self, vm: &mut VmContext<'_, '_>) -> bool
Invokes truthy on the underlying type’s TypeVtable.
sourcepub fn eq(
&self,
vm: ContextOrGuard<'_, '_, '_>,
rhs: &Value,
) -> Result<bool, Fault>
pub fn eq( &self, vm: ContextOrGuard<'_, '_, '_>, rhs: &Value, ) -> Result<bool, Fault>
Invokes eq on the underlying type’s TypeVtable.
Trait Implementations§
source§impl Clone for AnyDynamic
impl Clone for AnyDynamic
source§fn clone(&self) -> AnyDynamic
fn clone(&self) -> AnyDynamic
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for AnyDynamic
impl Debug for AnyDynamic
source§impl From<AnyDynamic> for AnyRef
impl From<AnyDynamic> for AnyRef
source§fn from(value: AnyDynamic) -> Self
fn from(value: AnyDynamic) -> Self
source§impl Hash for AnyDynamic
impl Hash for AnyDynamic
source§impl PartialEq for AnyDynamic
impl PartialEq for AnyDynamic
source§impl Trace for AnyDynamic
impl Trace for AnyDynamic
impl Copy for AnyDynamic
impl Eq for AnyDynamic
impl StructuralPartialEq for AnyDynamic
Auto Trait Implementations§
impl Freeze for AnyDynamic
impl RefUnwindSafe for AnyDynamic
impl Send for AnyDynamic
impl Sync for AnyDynamic
impl Unpin for AnyDynamic
impl UnwindSafe for AnyDynamic
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
§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)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)