pub trait HandleMessage {
type MaxMessageLen: Get<u32>;
// Required methods
fn handle_message(message: BoundedSlice<'_, u8, Self::MaxMessageLen>);
fn handle_messages<'a>(
messages: impl Iterator<Item = BoundedSlice<'a, u8, Self::MaxMessageLen>>,
);
fn sweep_queue();
fn footprint() -> QueueFootprint;
}
Expand description
Handles incoming messages for a single origin.
Required Associated Types§
Sourcetype MaxMessageLen: Get<u32>
type MaxMessageLen: Get<u32>
The maximal length any enqueued message may have.
Required Methods§
Sourcefn handle_message(message: BoundedSlice<'_, u8, Self::MaxMessageLen>)
fn handle_message(message: BoundedSlice<'_, u8, Self::MaxMessageLen>)
Enqueue a single message
with an implied origin.
Sourcefn handle_messages<'a>(
messages: impl Iterator<Item = BoundedSlice<'a, u8, Self::MaxMessageLen>>,
)
fn handle_messages<'a>( messages: impl Iterator<Item = BoundedSlice<'a, u8, Self::MaxMessageLen>>, )
Enqueue multiple messages
from an implied origin.
Sourcefn sweep_queue()
fn sweep_queue()
Any remaining unprocessed messages should happen only lazily, not proactively.
Sourcefn footprint() -> QueueFootprint
fn footprint() -> QueueFootprint
Return the state footprint of the queue.
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.