pub struct LoggingPlugin { /* private fields */ }Expand description
基础插件实现示例
Implementations§
Source§impl LoggingPlugin
impl LoggingPlugin
Trait Implementations§
Source§impl Clone for LoggingPlugin
impl Clone for LoggingPlugin
Source§fn clone(&self) -> LoggingPlugin
fn clone(&self) -> LoggingPlugin
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl HookHandler for LoggingPlugin
impl HookHandler for LoggingPlugin
Source§fn handle_hook<'life0, 'life1, 'async_trait>(
&'life0 self,
hook: PluginHook,
context: &'life1 mut HookContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_hook<'life0, 'life1, 'async_trait>(
&'life0 self,
hook: PluginHook,
context: &'life1 mut HookContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
处理钩子
Source§fn supports_hook(&self, hook: &PluginHook) -> bool
fn supports_hook(&self, hook: &PluginHook) -> bool
钩子是否支持特定类型
Source§fn get_priority(&self, _hook: &PluginHook) -> HookPriority
fn get_priority(&self, _hook: &PluginHook) -> HookPriority
获取钩子优先级
Source§impl Plugin for LoggingPlugin
impl Plugin for LoggingPlugin
fn name(&self) -> &str
fn version(&self) -> &str
fn description(&self) -> &str
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn hooks(&self) -> Vec<PluginHook>
Auto Trait Implementations§
impl Freeze for LoggingPlugin
impl RefUnwindSafe for LoggingPlugin
impl Send for LoggingPlugin
impl Sync for LoggingPlugin
impl Unpin for LoggingPlugin
impl UnwindSafe for LoggingPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more