pub struct SaTokenEventBus { /* private fields */ }Expand description
事件总线 - 管理所有监听器并分发事件
Implementations§
Source§impl SaTokenEventBus
impl SaTokenEventBus
Sourcepub async fn register(&self, listener: Arc<dyn SaTokenListener>)
pub async fn register(&self, listener: Arc<dyn SaTokenListener>)
注册监听器
Sourcepub async fn listener_count(&self) -> usize
pub async fn listener_count(&self) -> usize
获取监听器数量
Sourcepub async fn publish(&self, event: SaTokenEvent)
pub async fn publish(&self, event: SaTokenEvent)
发布事件
Trait Implementations§
Source§impl Clone for SaTokenEventBus
impl Clone for SaTokenEventBus
Source§fn clone(&self) -> SaTokenEventBus
fn clone(&self) -> SaTokenEventBus
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 moreAuto Trait Implementations§
impl Freeze for SaTokenEventBus
impl !RefUnwindSafe for SaTokenEventBus
impl Send for SaTokenEventBus
impl Sync for SaTokenEventBus
impl Unpin for SaTokenEventBus
impl !UnwindSafe for SaTokenEventBus
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