Trait RingMessage
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, RingKernelError>
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§
fn message_type() -> u64
fn message_type() -> u64
Get the message type discriminator.
fn message_id(&self) -> MessageId
fn message_id(&self) -> MessageId
Get the message ID.
fn deserialize(bytes: &[u8]) -> Result<Self, RingKernelError>where
Self: Sized,
fn deserialize(bytes: &[u8]) -> Result<Self, RingKernelError>where
Self: Sized,
Deserialize a message from bytes.
Provided Methods§
fn 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.