pub trait RingMessage:
Send
+ Sync
+ 'static {
// Required methods
fn message_type() -> u64;
fn message_id(&self) -> MessageId;
fn serialize(&self) -> Vec<u8> ⓘ;
fn deserialize(bytes: &[u8]) -> Result<Self>
where Self: Sized;
// Provided methods
fn correlation_id(&self) -> CorrelationId { ... }
fn priority(&self) -> Priority { ... }
fn size_hint(&self) -> usize
where Self: Sized { ... }
}Expand description
Required Methods§
Sourcefn message_type() -> u64
fn message_type() -> u64
Get the message type discriminator.
Sourcefn message_id(&self) -> MessageId
fn message_id(&self) -> MessageId
Get the message ID.
Sourcefn deserialize(bytes: &[u8]) -> Result<Self>where
Self: Sized,
fn deserialize(bytes: &[u8]) -> Result<Self>where
Self: Sized,
Deserialize a message from bytes.
Provided Methods§
Sourcefn correlation_id(&self) -> CorrelationId
fn correlation_id(&self) -> CorrelationId
Get the correlation ID (if any).
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.