pub trait Module: Send + Sync {
// Required methods
fn config(&self) -> ModuleConfig;
fn router(&self) -> Router;
// Provided methods
fn init(&self) -> CoolResult<()> { ... }
fn destroy(&self) -> CoolResult<()> { ... }
}Expand description
模块 trait
Required Methods§
Provided Methods§
Sourcefn init(&self) -> CoolResult<()>
fn init(&self) -> CoolResult<()>
模块初始化
Sourcefn destroy(&self) -> CoolResult<()>
fn destroy(&self) -> CoolResult<()>
模块销毁
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".