Trait hedwig::publish::Publisher[][src]

pub trait Publisher {
    type MessageId: 'static;
    type MessageError: Error + Send + Sync + 'static;
    type PublishStream: Stream<Item = Result<Self::MessageId, Self::MessageError>>;
    fn publish<'a, I>(&self, topic: Topic, messages: I) -> Self::PublishStream
    where
        I: Iterator<Item = &'a ValidatedMessage> + DoubleEndedIterator + ExactSizeIterator
; }
This is supported on crate feature publish only.
Expand description

Message publishers.

Message publishers deliver a validated message to an endpoint, possibly a remote one. Message publishers may also additionally validate a message for publisher-specific requirements (e.g. size).

Associated Types

The identifier for a successfully published message.

The error that this publisher returns when publishing of a message fails.

The stream of results that the publish method returns.

Required methods

Publish a batch of messages.

The output stream shall return a result for each message in messages slice in order.

Implementors