pub struct Callback<IN, OUT = ()> { /* private fields */ }
Expand description
Universal callback wrapper.
An Rc
wrapper is used to make it cloneable.
Implementations§
source§impl<IN: 'static, OUT: 'static> Callback<IN, OUT>
impl<IN: 'static, OUT: 'static> Callback<IN, OUT>
sourcepub fn reform<F, T>(&self, func: F) -> Callback<T, OUT>where
F: Fn(T) -> IN + 'static,
pub fn reform<F, T>(&self, func: F) -> Callback<T, OUT>where
F: Fn(T) -> IN + 'static,
Creates a new Callback
from another callback and a function.
That when emitted will call that function and will emit the original callback
sourcepub fn reform_ref<F, T>(&self, func: F) -> CallbackRef<T, OUT>
pub fn reform_ref<F, T>(&self, func: F) -> CallbackRef<T, OUT>
Creates a new CallbackRef
from another callback and a function.
That when emitted will call that function and will emit the original callback
sourcepub fn reform_ref_mut<F, T>(&self, func: F) -> CallbackRefMut<T, OUT>
pub fn reform_ref_mut<F, T>(&self, func: F) -> CallbackRefMut<T, OUT>
Creates a new CallbackRefMut
from another callback and a function.
That when emitted will call that function and will emit the original callback
sourcepub fn filter_reform<F, T>(&self, func: F) -> Callback<T, Option<OUT>>
pub fn filter_reform<F, T>(&self, func: F) -> Callback<T, Option<OUT>>
Creates a new Callback
from another callback and a function.
When emitted will call the function and, only if it returns Some(value)
, will emit
value
to the original callback.
sourcepub fn filter_reform_ref<F, T>(&self, func: F) -> CallbackRef<T, Option<OUT>>
pub fn filter_reform_ref<F, T>(&self, func: F) -> CallbackRef<T, Option<OUT>>
Creates a new CallbackRef
from another callback and a function.
When emitted will call the function and, only if it returns Some(value)
, will emit
value
to the original callback.
sourcepub fn filter_reform_ref_mut<F, T>(
&self,
func: F,
) -> CallbackRefMut<T, Option<OUT>>
pub fn filter_reform_ref_mut<F, T>( &self, func: F, ) -> CallbackRefMut<T, Option<OUT>>
Creates a new CallbackRefMut
from another callback and a function.
When emitted will call the function and, only if it returns Some(value)
, will emit
value
to the original callback.
Trait Implementations§
source§impl<T> From<UseReducerDispatcher<T>> for Callback<<T as Reducible>::Action>where
T: Reducible,
impl<T> From<UseReducerDispatcher<T>> for Callback<<T as Reducible>::Action>where
T: Reducible,
source§fn from(val: UseReducerDispatcher<T>) -> Self
fn from(val: UseReducerDispatcher<T>) -> Self
source§impl<T> From<UseStateSetter<T>> for Callback<T>
impl<T> From<UseStateSetter<T>> for Callback<T>
source§fn from(value: UseStateSetter<T>) -> Self
fn from(value: UseStateSetter<T>) -> Self
source§impl<IN, OUT> ImplicitClone for Callback<IN, OUT>
impl<IN, OUT> ImplicitClone for Callback<IN, OUT>
§fn implicit_clone(&self) -> Self
fn implicit_clone(&self) -> Self
source§impl<EVENT> IntoEventCallback<EVENT> for &Callback<EVENT>
impl<EVENT> IntoEventCallback<EVENT> for &Callback<EVENT>
source§fn into_event_callback(self) -> Option<Callback<EVENT>>
fn into_event_callback(self) -> Option<Callback<EVENT>>
self
to Option<Callback<EVENT>>
source§impl<EVENT> IntoEventCallback<EVENT> for Callback<EVENT>
impl<EVENT> IntoEventCallback<EVENT> for Callback<EVENT>
source§fn into_event_callback(self) -> Option<Callback<EVENT>>
fn into_event_callback(self) -> Option<Callback<EVENT>>
self
to Option<Callback<EVENT>>
source§impl<T> IntoPropValue<Callback<<T as Reducible>::Action>> for UseReducerDispatcher<T>where
T: Reducible,
impl<T> IntoPropValue<Callback<<T as Reducible>::Action>> for UseReducerDispatcher<T>where
T: Reducible,
source§impl<I, O, F> IntoPropValue<Callback<I, O>> for Fwhere
F: 'static + Fn(I) -> O,
impl<I, O, F> IntoPropValue<Callback<I, O>> for Fwhere
F: 'static + Fn(I) -> O,
source§fn into_prop_value(self) -> Callback<I, O>
fn into_prop_value(self) -> Callback<I, O>
self
to a value of a Properties
struct.source§impl<T> IntoPropValue<Callback<T>> for UseStateSetter<T>
impl<T> IntoPropValue<Callback<T>> for UseStateSetter<T>
source§fn into_prop_value(self) -> Callback<T>
fn into_prop_value(self) -> Callback<T>
self
to a value of a Properties
struct.Auto Trait Implementations§
impl<IN, OUT> Freeze for Callback<IN, OUT>
impl<IN, OUT = ()> !RefUnwindSafe for Callback<IN, OUT>
impl<IN, OUT = ()> !Send for Callback<IN, OUT>
impl<IN, OUT = ()> !Sync for Callback<IN, OUT>
impl<IN, OUT> Unpin for Callback<IN, OUT>
impl<IN, OUT = ()> !UnwindSafe for Callback<IN, OUT>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self
to a value of a Properties
struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self
to a value of a Properties
struct.