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§
Sourcefn model_callbacks() -> &'static ModelCallbacks<Self>
fn model_callbacks() -> &'static ModelCallbacks<Self>
Returns the model-level callback registry.
Provided Methods§
Sourcefn run_callbacks(&mut self, event: ModelEvent) -> CallbackResult
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.