pub trait Pluginwhere
Self: Sized,{
// Required methods
fn new() -> Self;
fn enable(&mut self);
// Provided methods
fn disable(&mut self) { ... }
fn should_drop() -> bool { ... }
}Required Methods§
Provided Methods§
Sourcefn should_drop() -> bool
fn should_drop() -> bool
是否应该在插件被禁用后销毁插件实例
若为false,则插件只会在卸载时销毁实例
本函数仅会调用一次
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.