pub struct Callback(_);
Expand description
Callback is a function that can be triggered by an event. It has a mutable access to the cursive root.
It is meant to be stored in views.
Implementations
sourceimpl Callback
impl Callback
sourcepub fn from_fn<F>(f: F) -> Callbackwhere
F: 'static + Fn(&mut Cursive),
pub fn from_fn<F>(f: F) -> Callbackwhere
F: 'static + Fn(&mut Cursive),
Wraps the given function into a Callback
object.
sourcepub fn from_fn_mut<F>(f: F) -> Callbackwhere
F: 'static + FnMut(&mut Cursive),
pub fn from_fn_mut<F>(f: F) -> Callbackwhere
F: 'static + FnMut(&mut Cursive),
Wrap a FnMut
into a Callback
object.
If this methods tries to call itself, nested calls will be no-ops.
sourcepub fn from_fn_once<F>(f: F) -> Callbackwhere
F: 'static + FnOnce(&mut Cursive),
pub fn from_fn_once<F>(f: F) -> Callbackwhere
F: 'static + FnOnce(&mut Cursive),
Wrap a FnOnce
into a Callback
object.
After being called once, the callback will become a no-op.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Callback
impl !Send for Callback
impl !Sync for Callback
impl Unpin for Callback
impl !UnwindSafe for Callback
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more