pub struct PluginChain { /* private fields */ }Expand description
插件链(按注册顺序执行)
Implementations§
Source§impl PluginChain
impl PluginChain
Sourcepub fn new() -> PluginChain
pub fn new() -> PluginChain
创建空链
Sourcepub fn unregister(&self, name: &str) -> bool
pub fn unregister(&self, name: &str) -> bool
注销指定名称的插件
Sourcepub fn plugin_names(&self) -> Vec<String>
pub fn plugin_names(&self) -> Vec<String>
列出所有插件名
Sourcepub fn execute(&self, context: &mut PluginContext) -> PluginDecision
pub fn execute(&self, context: &mut PluginContext) -> PluginDecision
执行插件链
按 before 插件 → 原操作 → after 插件 的顺序执行。
任意插件返回 Abort 中止整个链。
任意插件返回 Modified 会修改 context 后继续。
任意插件返回 Skip 跳过后续插件(但继续原操作)。
Trait Implementations§
Source§impl Debug for PluginChain
impl Debug for PluginChain
Source§impl Default for PluginChain
impl Default for PluginChain
Source§fn default() -> PluginChain
fn default() -> PluginChain
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PluginChain
impl !RefUnwindSafe for PluginChain
impl !UnwindSafe for PluginChain
impl Send for PluginChain
impl Sync for PluginChain
impl Unpin for PluginChain
impl UnsafeUnpin for PluginChain
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more