pub struct CommandPublisher { /* private fields */ }Expand description
A publisher middleware that intercepts messages and passes them to a Handler.
If the handler returns a new message, it is passed to the inner publisher.
Implementations§
Source§impl CommandPublisher
impl CommandPublisher
pub fn new( inner: impl MessagePublisher, handler: impl Handler + 'static, ) -> Self
Trait Implementations§
Source§impl MessagePublisher for CommandPublisher
impl MessagePublisher for CommandPublisher
fn send<'life0, 'async_trait>(
&'life0 self,
message: CanonicalMessage,
) -> Pin<Box<dyn Future<Output = Result<Sent, PublisherError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn send_batch<'life0, 'async_trait>(
&'life0 self,
messages: Vec<CanonicalMessage>,
) -> Pin<Box<dyn Future<Output = Result<SentBatch, PublisherError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_batch<'life0, 'async_trait>(
&'life0 self,
messages: Vec<CanonicalMessage>,
) -> Pin<Box<dyn Future<Output = Result<SentBatch, PublisherError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a batch of messages. Read more
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn as_any(&self) -> &dyn Any
Auto Trait Implementations§
impl Freeze for CommandPublisher
impl !RefUnwindSafe for CommandPublisher
impl Send for CommandPublisher
impl Sync for CommandPublisher
impl Unpin for CommandPublisher
impl !UnwindSafe for CommandPublisher
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