[−][src]Struct sauron::Callback
A generic sized representation of a function that can be attached to a Node. The callback will essentially be owned by the element
Methods
impl<EVENT, MSG> Callback<EVENT, MSG> where
EVENT: 'static,
MSG: 'static,
[src]
EVENT: 'static,
MSG: 'static,
pub fn emit<T>(&self, value: T) -> MSG where
T: Into<EVENT>,
[src]
T: Into<EVENT>,
This method calls the actual callback.
pub fn reform<F, EVENT2>(self, func: F) -> Callback<EVENT2, MSG> where
F: Fn(EVENT2) -> EVENT + 'static,
[src]
F: Fn(EVENT2) -> EVENT + 'static,
Changes input type of the callback to another.
Works like common map
method but in an opposite direction.
pub fn map<F, MSG2>(self, func: F) -> Callback<EVENT, MSG2> where
F: Fn(MSG) -> MSG2 + 'static,
[src]
F: Fn(MSG) -> MSG2 + 'static,
Map the output of this callback to return a different type
pub fn map_callback<MSG2>(
self,
cb: Callback<MSG, MSG2>
) -> Callback<EVENT, MSG2> where
MSG2: 'static,
[src]
self,
cb: Callback<MSG, MSG2>
) -> Callback<EVENT, MSG2> where
MSG2: 'static,
Trait Implementations
impl<EVENT, MSG> Debug for Callback<EVENT, MSG>
[src]
impl<EVENT, F, MSG> From<F> for Callback<EVENT, MSG> where
F: Fn(EVENT) -> MSG + 'static,
[src]
F: Fn(EVENT) -> MSG + 'static,
impl<EVENT, MSG> PartialEq<Callback<EVENT, MSG>> for Callback<EVENT, MSG>
[src]
fn eq(&self, rhs: &Callback<EVENT, MSG>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<EVENT, MSG> Clone for Callback<EVENT, MSG>
[src]
Auto Trait Implementations
impl<EVENT, MSG> !Send for Callback<EVENT, MSG>
impl<EVENT, MSG> !Sync for Callback<EVENT, MSG>
impl<EVENT, MSG> Unpin for Callback<EVENT, MSG>
impl<EVENT, MSG> !UnwindSafe for Callback<EVENT, MSG>
impl<EVENT, MSG> !RefUnwindSafe for Callback<EVENT, MSG>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,