Struct muse_lang::runtime::value::AnyDynamicRoot
source · pub struct AnyDynamicRoot(/* private fields */);Expand description
A strong reference to a Rooted<T>.
Implementations§
source§impl AnyDynamicRoot
impl AnyDynamicRoot
sourcepub const fn downgrade(&self) -> AnyDynamic
pub const fn downgrade(&self) -> AnyDynamic
Returns a weak reference to this dynamic.
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 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) -> Option<Rooted<T>>where
T: DynamicValue + Trace,
pub fn as_rooted<T>(&self) -> 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<T>(&self) -> Option<&T>where
T: DynamicValue + Trace,
pub fn downcast_ref<T>(&self) -> Option<&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.
Trait Implementations§
source§impl Clone for AnyDynamicRoot
impl Clone for AnyDynamicRoot
source§fn clone(&self) -> AnyDynamicRoot
fn clone(&self) -> AnyDynamicRoot
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 AnyDynamicRoot
impl Debug for AnyDynamicRoot
impl ContainsNoRefs for AnyDynamicRoot
Auto Trait Implementations§
impl Freeze for AnyDynamicRoot
impl RefUnwindSafe for AnyDynamicRoot
impl Send for AnyDynamicRoot
impl Sync for AnyDynamicRoot
impl Unpin for AnyDynamicRoot
impl UnwindSafe for AnyDynamicRoot
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)