pub struct InMemoryBus { /* private fields */ }Expand description
In-process bus using tokio broadcast channels. Suitable for single-node mode. Not persistent.
Implementations§
Source§impl InMemoryBus
impl InMemoryBus
Trait Implementations§
Source§impl Bus for InMemoryBus
impl Bus for InMemoryBus
Source§fn publish<'life0, 'async_trait>(
&'life0 self,
msg: BusMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
msg: BusMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publish a message to a topic
Source§fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
handler: Box<dyn Fn(BusMessage) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
handler: Box<dyn Fn(BusMessage) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe to a topic with a handler
Auto Trait Implementations§
impl Freeze for InMemoryBus
impl !RefUnwindSafe for InMemoryBus
impl Send for InMemoryBus
impl Sync for InMemoryBus
impl Unpin for InMemoryBus
impl UnsafeUnpin for InMemoryBus
impl !UnwindSafe for InMemoryBus
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