pub struct CallbackHolder { /* private fields */ }Implementations§
Source§impl CallbackHolder
impl CallbackHolder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new holder with a no-op callback so that callers can immediately invoke it.
Sourcepub fn update<F>(&self, f: F)where
F: FnMut() + 'static,
pub fn update<F>(&self, f: F)where
F: FnMut() + 'static,
Replace the stored callback with a new closure provided by the caller.
Sourcepub fn update_boxed(&self, f: Box<dyn FnMut() + 'static>)
pub fn update_boxed(&self, f: Box<dyn FnMut() + 'static>)
Boxed form of Self::update: lets generated composable helpers take
callbacks type-erased at the public-fn boundary, so helper bodies are
compiled once instead of once per caller closure type.
Trait Implementations§
Source§impl Clone for CallbackHolder
impl Clone for CallbackHolder
Source§fn clone(&self) -> CallbackHolder
fn clone(&self) -> CallbackHolder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CallbackHolder
impl !Send for CallbackHolder
impl !Sync for CallbackHolder
impl !UnwindSafe for CallbackHolder
impl Freeze for CallbackHolder
impl Unpin for CallbackHolder
impl UnsafeUnpin for CallbackHolder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more