pub struct Callback { /* private fields */ }Expand description
A callback that can be used for event listeners in the function
[add_event_listener], it gets passed down to the exported
__afia__$handle_event function.
Implementations§
Source§impl Callback
impl Callback
Sourcepub fn temporary_way_to_call_using_integer_event_handle(
&self,
event_handle: i64,
)
pub fn temporary_way_to_call_using_integer_event_handle( &self, event_handle: i64, )
TODO: Delete this. Just a way for us to let some of our older code make use of this newer
Callback abstraction.
This is currently used in one place. We should not use it anywhere else. Once we delete
that place we can delete this method.
Sourcepub fn new_with_context_pointer<T>(
context: *mut T,
imports: &'static ComponentImports,
callback: fn(DomEvent, *mut T),
) -> Self
pub fn new_with_context_pointer<T>( context: *mut T, imports: &'static ComponentImports, callback: fn(DomEvent, *mut T), ) -> Self
Create a Callback by providing a function that takes an event handle
and a pointer to the associated context.
Sourcepub fn new_without_context(
imports: &'static ComponentImports,
callback: fn(DomEvent),
) -> Self
pub fn new_without_context( imports: &'static ComponentImports, callback: fn(DomEvent), ) -> Self
Create a Callback by providing a function that takes an event
handle as an argument.
Auto Trait Implementations§
impl Freeze for Callback
impl RefUnwindSafe for Callback
impl !Send for Callback
impl !Sync for Callback
impl Unpin for Callback
impl UnsafeUnpin for Callback
impl UnwindSafe for Callback
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