[][src]Struct cursive::event::Callback

pub struct Callback(_);

Callback is a function that can be triggered by an event. It has a mutable access to the cursive root.

Methods

impl Callback[src]

pub fn from_fn<F>(f: F) -> Self where
    F: 'static + Fn(&mut Cursive), 
[src]

Wraps the given function into a Callback object.

pub fn from_fn_mut<F>(f: F) -> Self where
    F: 'static + FnMut(&mut Cursive), 
[src]

Wrap a FnMut into a Callback object.

If this methods tries to call itself, nested calls will be no-ops.

pub fn dummy() -> Self[src]

Returns a dummy callback that doesn't run anything.

Methods from Deref<Target = Box<dyn Fn(&mut Cursive)>>

Trait Implementations

impl Clone for Callback[src]

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

Performs copy-assignment from source. Read more

impl From<Rc<Box<dyn Fn(&mut Cursive) + 'static>>> for Callback[src]

impl From<Box<dyn Fn(&mut Cursive) + 'static + Send>> for Callback[src]

impl From<Box<dyn Fn(&mut Cursive) + 'static>> for Callback[src]

impl Deref for Callback[src]

type Target = Box<dyn Fn(&mut Cursive)>

The resulting type after dereferencing.

Auto Trait Implementations

impl Unpin for Callback

impl !Sync for Callback

impl !Send for Callback

impl !UnwindSafe for Callback

impl !RefUnwindSafe for Callback

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T[src]