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,
§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.