pub struct InMemoryConsumer<T: Clone + Send + Sync + 'static> { /* private fields */ }Expand description
An in-memory message consumer.
Trait Implementations§
Source§impl EventConsumer for InMemoryConsumer<Value>
impl EventConsumer for InMemoryConsumer<Value>
Source§impl<T: Clone + Send + Sync + 'static> MessageConsumer<T> for InMemoryConsumer<T>
impl<T: Clone + Send + Sync + 'static> MessageConsumer<T> for InMemoryConsumer<T>
Source§fn subscribe<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topics: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn subscribe<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topics: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Subscribe to one or more topics.
Source§fn recv<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<Message<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<Message<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive the next message. Blocks until a message is available.
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close or shut down the consumer. Implementations with no persistent resources may no-op.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for InMemoryConsumer<T>
impl<T> !UnwindSafe for InMemoryConsumer<T>
impl<T> Freeze for InMemoryConsumer<T>
impl<T> Send for InMemoryConsumer<T>
impl<T> Sync for InMemoryConsumer<T>
impl<T> Unpin for InMemoryConsumer<T>
impl<T> UnsafeUnpin for InMemoryConsumer<T>
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