[][src]Struct sauron_native::Callback

pub struct Callback<EVENT, MSG>(_);

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]

pub fn emit<T>(&self, value: T) -> MSG where
    T: Into<EVENT>, 
[src]

This method calls the actual callback.

pub fn reform<F, EVENT2>(self, func: F) -> Callback<EVENT2, MSG> where
    F: Fn(EVENT2) -> EVENT + 'static, 
[src]

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]

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]

Trait Implementations

impl<EVENT, MSG> Clone for Callback<EVENT, MSG>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<EVENT, F, MSG> From<F> for Callback<EVENT, MSG> where
    F: Fn(EVENT) -> MSG + 'static, 
[src]

impl<EVENT, MSG> Debug for Callback<EVENT, MSG>[src]

impl<EVENT, MSG> PartialEq<Callback<EVENT, MSG>> for Callback<EVENT, MSG>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

Auto Trait Implementations

impl<EVENT, MSG> !Sync for Callback<EVENT, MSG>

impl<EVENT, MSG> !Send for Callback<EVENT, MSG>

impl<EVENT, MSG> Unpin for Callback<EVENT, MSG>

impl<EVENT, MSG> !RefUnwindSafe for Callback<EVENT, MSG>

impl<EVENT, MSG> !UnwindSafe for Callback<EVENT, MSG>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]