Struct cursive_core::event::Callback
source · 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§
source§impl Callback
impl Callback
sourcepub fn from_fn<F>(f: F) -> Selfwhere
F: 'static + Fn(&mut Cursive),
pub fn from_fn<F>(f: F) -> Selfwhere
F: 'static + Fn(&mut Cursive),
Wraps the given function into a Callback
object.
sourcepub fn from_fn_mut<F>(f: F) -> Selfwhere
F: 'static + FnMut(&mut Cursive),
pub fn from_fn_mut<F>(f: F) -> Selfwhere
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) -> Selfwhere
F: 'static + FnOnce(&mut Cursive),
pub fn from_fn_once<F>(f: F) -> Selfwhere
F: 'static + FnOnce(&mut Cursive),
Wrap a FnOnce
into a Callback
object.
After being called once, the callback will become a no-op.