Skip to main content

HasModelCallbacks

Trait HasModelCallbacks 

Source
pub trait HasModelCallbacks:
    Send
    + Sync
    + Sized
    + 'static {
    // Required method
    fn model_callbacks() -> &'static ModelCallbacks<Self>;

    // Provided method
    fn run_callbacks(&mut self, event: ModelEvent) -> CallbackResult { ... }
}
Expand description

Trait for models that expose lifecycle callbacks.

Required Methods§

Source

fn model_callbacks() -> &'static ModelCallbacks<Self>

Returns the model-level callback registry.

Provided Methods§

Source

fn run_callbacks(&mut self, event: ModelEvent) -> CallbackResult

Runs the callback chain associated with the lifecycle event.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§