pub struct AnyUserData<'gc>(/* private fields */);Implementations§
Source§impl<'gc> AnyUserData<'gc>
impl<'gc> AnyUserData<'gc>
pub fn new<R>(mc: &Mutation<'gc>, val: Root<'gc, R>) -> Selfwhere
R: for<'a> Rootable<'a>,
pub fn new_static<R: 'static>(mc: &Mutation<'gc>, val: R) -> Self
pub fn is<R>(&self) -> boolwhere
R: for<'a> Rootable<'a>,
pub fn is_static<R: 'static>(&self) -> bool
pub fn downcast<'a, R>(&'a self) -> Result<&'gc Root<'gc, R>, BadUserDataType>where
R: for<'b> Rootable<'b>,
pub fn downcast_write<'a, R>(
&'a self,
mc: &Mutation<'gc>,
) -> Result<&'gc Write<Root<'gc, R>>, BadUserDataType>where
R: for<'b> Rootable<'b>,
pub fn downcast_static<'a, R: 'static>( &'a self, ) -> Result<&'gc R, BadUserDataType>
pub fn metatable(&self) -> Option<Table<'gc>>
pub fn set_metatable( &self, mc: &Mutation<'gc>, metatable: Option<Table<'gc>>, ) -> Option<Table<'gc>>
pub fn as_ptr(&self) -> *const ()
Trait Implementations§
Source§impl<'gc> Clone for AnyUserData<'gc>
impl<'gc> Clone for AnyUserData<'gc>
Source§fn clone(&self) -> AnyUserData<'gc>
fn clone(&self) -> AnyUserData<'gc>
Returns a duplicate 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<'gc> Collect for AnyUserData<'gc>
impl<'gc> Collect for AnyUserData<'gc>
Source§fn needs_trace() -> bool
fn needs_trace() -> bool
As an optimization, if this type can never hold a
Gc pointer and trace is unnecessary
to call, you may implement this method and return false. The default implementation returns
true, signaling that Collect::trace must be called.Source§fn trace(&self, cc: &Collection)
fn trace(&self, cc: &Collection)
Must call
Collect::trace on all held Gc pointers. If this type holds inner types that
implement Collect, a valid implementation would simply call Collect::trace on all the
held values to ensure this.Source§impl<'gc> Debug for AnyUserData<'gc>
impl<'gc> Debug for AnyUserData<'gc>
Source§impl<'gc> Hash for AnyUserData<'gc>
impl<'gc> Hash for AnyUserData<'gc>
Source§impl<'gc> PartialEq for AnyUserData<'gc>
impl<'gc> PartialEq for AnyUserData<'gc>
Source§impl<'gc> Stashable<'gc> for AnyUserData<'gc>
impl<'gc> Stashable<'gc> for AnyUserData<'gc>
type Stashed = StaticUserData
fn stash(self, roots: &DynamicRootSet<'gc>, mc: &Mutation<'gc>) -> Self::Stashed
impl<'gc> Copy for AnyUserData<'gc>
impl<'gc> Eq for AnyUserData<'gc>
Auto Trait Implementations§
impl<'gc> Freeze for AnyUserData<'gc>
impl<'gc> !RefUnwindSafe for AnyUserData<'gc>
impl<'gc> !Send for AnyUserData<'gc>
impl<'gc> !Sync for AnyUserData<'gc>
impl<'gc> Unpin for AnyUserData<'gc>
impl<'gc> !UnwindSafe for AnyUserData<'gc>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.