pub trait CallbackRef<T: ?Sized> {
// Required method
fn callback_ref(&mut self, payload: &T);
// Provided method
fn into_callback(self) -> impl Callback<T>
where Self: Sized,
T: Sized { ... }
}Expand description
Required Methods§
fn callback_ref(&mut self, payload: &T)
Provided Methods§
Sourcefn into_callback(self) -> impl Callback<T>
fn into_callback(self) -> impl Callback<T>
Compatibility helper to convert any CallbackRef into a Callback when T is Sized.
This provides maximum compatibility when ownership of T is not required, as it allows users
to always implement CallbackRef which can then be used in either circumstance.