Trait Message

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§