Skip to main content

Callback

Struct Callback 

Source
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

Source

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.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.