pub struct StaticUserMethods<'gc, U: 'static> { /* private fields */ }
Implementations§
Source§impl<'gc, U: 'static> StaticUserMethods<'gc, U>
impl<'gc, U: 'static> StaticUserMethods<'gc, U>
pub fn new(mc: &Mutation<'gc>) -> Self
pub fn add<F, A, R>(
self,
name: &'static str,
ctx: Context<'gc>,
method: F,
) -> boolwhere
F: Fn(&U, Context<'gc>, Execution<'gc, '_>, A) -> Result<R, Error<'gc>> + 'static,
A: FromMultiValue<'gc>,
R: IntoMultiValue<'gc>,
pub fn metatable(self, ctx: Context<'gc>) -> Table<'gc>
pub fn wrap(self, ctx: Context<'gc>, ud: U) -> UserData<'gc>
Trait Implementations§
Source§impl<'gc, U: 'static> Clone for StaticUserMethods<'gc, U>
impl<'gc, U: 'static> Clone for StaticUserMethods<'gc, U>
Source§impl<'gc, U: 'static> Collect for StaticUserMethods<'gc, U>
impl<'gc, U: 'static> Collect for StaticUserMethods<'gc, U>
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, U: 'static> IntoValue<'gc> for StaticUserMethods<'gc, U>
impl<'gc, U: 'static> IntoValue<'gc> for StaticUserMethods<'gc, U>
fn into_value(self, _: Context<'gc>) -> Value<'gc>
impl<'gc, U: 'static> Copy for StaticUserMethods<'gc, U>
Auto Trait Implementations§
impl<'gc, U> Freeze for StaticUserMethods<'gc, U>
impl<'gc, U> !RefUnwindSafe for StaticUserMethods<'gc, U>
impl<'gc, U> !Send for StaticUserMethods<'gc, U>
impl<'gc, U> !Sync for StaticUserMethods<'gc, U>
impl<'gc, U> Unpin for StaticUserMethods<'gc, U>where
U: Unpin,
impl<'gc, U> !UnwindSafe for StaticUserMethods<'gc, U>
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