pub struct EventBus { /* private fields */ }
Expand description
事件总线
Implementations§
Source§impl EventBus
impl EventBus
pub async fn restart(&self) -> EditorResult<()>
pub async fn add_event_handler( &mut self, event_handler: Arc<dyn EventHandler>, ) -> EditorResult<()>
pub async fn add_event_handlers( &mut self, event_handlers: Vec<Arc<dyn EventHandler>>, ) -> EditorResult<()>
Sourcepub fn start_event_loop(&self)
pub fn start_event_loop(&self)
启动事件循环
pub fn new() -> Self
pub fn subscribe(&self) -> Receiver<Event>
pub async fn broadcast(&self, event: Event) -> EditorResult<()>
pub fn broadcast_blocking(&self, event: Event) -> EditorResult<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventBus
impl !RefUnwindSafe for EventBus
impl Send for EventBus
impl Sync for EventBus
impl !Unpin for EventBus
impl !UnwindSafe for EventBus
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