pub trait EventBus<T: Debug + Serialize + for<'de> Deserialize<'de>>: Producer<T> + Consumer<T> {
    // Required methods
    fn new<'async_trait>(    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn new_config<'async_trait>(
        connection_config: ConnectionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}Required Methods§
Sourcefn new<'async_trait>() -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
    Self: Sized + 'async_trait,
 
fn new<'async_trait>() -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
    Self: Sized + 'async_trait,
§返回
返回初始化后的 EventBus 本身。