pub trait ManagedModule: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn mount(&self);
fn activate(&self);
fn deactivate(&self);
fn destroy(&self);
// Provided method
fn is_persistent(&self) -> bool { ... }
}Expand description
Type-erased module handle managed by ManagedRouter.
Implemented for ModuleInstance<S> for every S: State; users with
custom module shells can implement it themselves to participate in
route-driven lifecycle.
Required Methods§
fn name(&self) -> &str
fn mount(&self)
fn activate(&self)
fn deactivate(&self)
fn destroy(&self)
Provided Methods§
Sourcefn is_persistent(&self) -> bool
fn is_persistent(&self) -> bool
Whether this module’s definition opted into persistence.
Defaults to false — match the TS / Swift contract where
persistence is opt-in via .persist().
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".