pub struct CallbackRef<IN, OUT = ()> { /* private fields */ }
Expand description
Universal callback wrapper with reference in argument.
An Rc
wrapper is used to make it cloneable.
Implementations§
source§impl<IN, OUT> CallbackRef<IN, OUT>
impl<IN, OUT> CallbackRef<IN, OUT>
source§impl<IN> CallbackRef<IN>
impl<IN> CallbackRef<IN>
source§impl<IN: 'static, OUT: 'static> CallbackRef<IN, OUT>
impl<IN: 'static, OUT: 'static> CallbackRef<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<IN, OUT> Clone for CallbackRef<IN, OUT>
impl<IN, OUT> Clone for CallbackRef<IN, OUT>
source§impl<IN, OUT> Debug for CallbackRef<IN, OUT>
impl<IN, OUT> Debug for CallbackRef<IN, OUT>
source§impl<IN> Default for CallbackRef<IN>
impl<IN> Default for CallbackRef<IN>
source§impl<IN, OUT> ImplicitClone for CallbackRef<IN, OUT>
impl<IN, OUT> ImplicitClone for CallbackRef<IN, OUT>
§fn implicit_clone(&self) -> Self
fn implicit_clone(&self) -> Self
source§impl<IN, OUT> PartialEq for CallbackRef<IN, OUT>
impl<IN, OUT> PartialEq for CallbackRef<IN, OUT>
Auto Trait Implementations§
impl<IN, OUT> Freeze for CallbackRef<IN, OUT>
impl<IN, OUT = ()> !RefUnwindSafe for CallbackRef<IN, OUT>
impl<IN, OUT = ()> !Send for CallbackRef<IN, OUT>
impl<IN, OUT = ()> !Sync for CallbackRef<IN, OUT>
impl<IN, OUT> Unpin for CallbackRef<IN, OUT>
impl<IN, OUT = ()> !UnwindSafe for CallbackRef<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.