Skip to main content

AsCallback

Trait AsCallback 

Source
pub trait AsCallback: Send + Sync {
    // Required methods
    fn get_id(&self) -> CallbackId;
    fn get_fn(&self) -> &Function;
}
Expand description

Trait allowing to bind a generic Callback struct with a CallbackId identifier.

Required Methods§

Source

fn get_id(&self) -> CallbackId

Returns the unique CallbackId identifying this callback.

Source

fn get_fn(&self) -> &Function

Returns the underlying JavaScript Function bound to this callback.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> AsCallback for Callback<T>
where T: ?Sized + WasmClosure + 'static,