pub trait Message {
    type UserMessage;
    type ControlMessage;

    // Required methods
    fn classify(self) -> Classification<Self::UserMessage, Self::ControlMessage>;
    fn is_error(user_message: &Self::UserMessage) -> bool;
}
Expand description

A trait allowing our stream and subscription infrastructure to work with messages.

Required Associated Types§

source

type UserMessage

A message that is relevant to the user.

source

type ControlMessage

An internally used control message.

Required Methods§

source

fn classify(self) -> Classification<Self::UserMessage, Self::ControlMessage>

Classify a message as a user-relevant message or a control message.

source

fn is_error(user_message: &Self::UserMessage) -> bool

Check whether a user message is considered an error. Erroneous messages cause any ongoing Subscription::send or Subscription::read requests to result in an error.

Object Safety§

This trait is not object safe.

Implementors§