[−][src]Enum yew::callback::Callback
Universal callback wrapper.
`Rc` wrapper used to make it clonable.Variants
A callback that can be called multiple times
A callback that will only be called once. Panics if it is called again
Methods
impl<IN> Callback<IN>
[src]
pub fn emit(&self, value: IN)
[src]
This method calls the actual callback.
pub fn once<F>(func: F) -> Self where
F: FnOnce(IN) + 'static,
[src]
F: FnOnce(IN) + 'static,
Creates a callback from a FnOnce. You are responsible for ensuring the callback is only called once otherwise it will panic.
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]
F: Fn(T) -> IN + 'static,
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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
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> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,