pub struct AnyCallback<'gc>(/* private fields */);Implementations§
Source§impl<'gc> AnyCallback<'gc>
impl<'gc> AnyCallback<'gc>
pub fn new<C: Callback<'gc> + 'gc>(mc: &Mutation<'gc>, callback: C) -> Self
pub fn from_fn<F>(mc: &Mutation<'gc>, call: F) -> AnyCallback<'gc>
pub fn from_fn_with<R, F>( mc: &Mutation<'gc>, root: R, call: F, ) -> AnyCallback<'gc>
pub fn as_ptr(self) -> *const ()
pub fn call( self, ctx: Context<'gc>, args: Vec<Value<'gc>>, ) -> Result<CallbackReturn<'gc>, Error<'gc>>
Trait Implementations§
Source§impl<'gc> Clone for AnyCallback<'gc>
impl<'gc> Clone for AnyCallback<'gc>
Source§fn clone(&self) -> AnyCallback<'gc>
fn clone(&self) -> AnyCallback<'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 AnyCallback<'gc>
impl<'gc> Collect for AnyCallback<'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 AnyCallback<'gc>
impl<'gc> Debug for AnyCallback<'gc>
Source§impl<'gc> From<AnyCallback<'gc>> for Function<'gc>
impl<'gc> From<AnyCallback<'gc>> for Function<'gc>
Source§fn from(callback: AnyCallback<'gc>) -> Self
fn from(callback: AnyCallback<'gc>) -> Self
Converts to this type from the input type.
Source§impl<'gc> From<AnyCallback<'gc>> for Value<'gc>
impl<'gc> From<AnyCallback<'gc>> for Value<'gc>
Source§fn from(v: AnyCallback<'gc>) -> Value<'gc>
fn from(v: AnyCallback<'gc>) -> Value<'gc>
Converts to this type from the input type.
Source§impl<'gc> FromValue<'gc> for AnyCallback<'gc>
impl<'gc> FromValue<'gc> for AnyCallback<'gc>
Source§impl<'gc> Hash for AnyCallback<'gc>
impl<'gc> Hash for AnyCallback<'gc>
Source§impl<'gc> PartialEq for AnyCallback<'gc>
impl<'gc> PartialEq for AnyCallback<'gc>
Source§impl<'gc> Stashable<'gc> for AnyCallback<'gc>
impl<'gc> Stashable<'gc> for AnyCallback<'gc>
type Stashed = StaticCallback
fn stash(self, roots: &DynamicRootSet<'gc>, mc: &Mutation<'gc>) -> Self::Stashed
impl<'gc> Copy for AnyCallback<'gc>
impl<'gc> Eq for AnyCallback<'gc>
Auto Trait Implementations§
impl<'gc> Freeze for AnyCallback<'gc>
impl<'gc> !RefUnwindSafe for AnyCallback<'gc>
impl<'gc> !Send for AnyCallback<'gc>
impl<'gc> !Sync for AnyCallback<'gc>
impl<'gc> Unpin for AnyCallback<'gc>
impl<'gc> !UnwindSafe for AnyCallback<'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.