pub trait EncodableMessage {
    type Error;
    type Validator;

    // Required methods
    fn topic(&self) -> Topic;
    fn encode(
        &self,
        validator: &Self::Validator
    ) -> Result<ValidatedMessage<Bytes>, Self::Error>;
}
Expand description

Types that can be encoded and published.

Required Associated Types§

source

type Error

The errors that can occur when calling the EncodableMessage::encode method.

Will typically match the errors returned by the EncodableMessage::Validator.

source

type Validator

The validator to use for this message.

Required Methods§

source

fn topic(&self) -> Topic

Topic into which this message shall be published.

source

fn encode( &self, validator: &Self::Validator ) -> Result<ValidatedMessage<Bytes>, Self::Error>

Encode the message payload.

Implementors§