[][src]Struct yew::callback::Callback

pub struct Callback<IN>(_);

Universal callback wrapper.

`Rc` wrapper used to make it clonable.

Methods

impl<IN> Callback<IN>[src]

pub fn emit(&self, value: IN)[src]

This method calls the actual callback.

pub fn noop() -> Self[src]

Creates a no-op callback which can be used when it is not suitable to use an Option<Callback>.

impl<IN: 'static> Callback<IN>[src]

pub fn reform<F, T>(&self, func: F) -> Callback<T> where
    F: Fn(T) -> IN + 'static, 
[src]

Changes input type of the callback to another. Works like common map method but in an opposite direction.

Trait Implementations

impl<IN> Clone for Callback<IN>[src]

impl<IN> Debug for Callback<IN>[src]

impl<IN> Default for Callback<IN>[src]

impl<IN, F: Fn(IN) + 'static> From<F> for Callback<IN>[src]

impl<IN> PartialEq<Callback<IN>> for Callback<IN>[src]

Auto Trait Implementations

impl<IN> !RefUnwindSafe for Callback<IN>

impl<IN> !Send for Callback<IN>

impl<IN> !Sync for Callback<IN>

impl<IN> Unpin for Callback<IN>

impl<IN> !UnwindSafe for Callback<IN>

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

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

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

impl<T> CloneAny for T where
    T: Clone + Any
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.