pub struct LogPlugin { /* private fields */ }Expand description
内置日志插件:注册名 “log”,只订阅 EVENT_LOG,deps 为空。
Implementations§
Trait Implementations§
Source§impl Plugin for LogPlugin
impl Plugin for LogPlugin
Source§fn routes(&self) -> Vec<Cow<'static, str>>
fn routes(&self) -> Vec<Cow<'static, str>>
订阅的 type 集合:广播 type(如业务常量 “eTick.”)、
自身的寻址 type(e_req_type(本名)/e_to_type(本名))。
宿主 start() 装配 forwarder → 邮箱 → on_mail。
Source§fn on_mail(&self, event: &Event)
fn on_mail(&self, event: &Event)
★ 唯一业务入口:永远在本插件 worker 线程上串行执行。
广播事件、寻址请求(eReq.<本名>)、定向通知(eTo.<本名>)都从这里进。
Source§fn mailbox_cap(&self) -> usize
fn mailbox_cap(&self) -> usize
邮箱容量覆写(D5:按插件可小可大,默认
MAILBOX_CAP)。Source§fn on_init(&self, _ctx: &PluginContext)
fn on_init(&self, _ctx: &PluginContext)
可选:启动前纯接线(缓存 ctx、读配置)。禁止在此 put/注册 handler(规范)。
Auto Trait Implementations§
impl !Freeze for LogPlugin
impl RefUnwindSafe for LogPlugin
impl Send for LogPlugin
impl Sync for LogPlugin
impl Unpin for LogPlugin
impl UnsafeUnpin for LogPlugin
impl UnwindSafe for LogPlugin
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