Skip to main content

ReadMessage

Trait ReadMessage 

Source
pub trait ReadMessage {
    // Required methods
    fn pop_erased(&mut self) -> Option<Erased>;
    fn try_pop<M: Debug + 'static>(&mut self) -> Option<M>;
    fn try_peek<M: Debug + 'static>(&self) -> Option<&M>;
    fn peek_debug(&self) -> Option<&dyn Debug>;
}
Expand description

This trait allows peeking and popping messages from the stack

Required Methods§

Source

fn pop_erased(&mut self) -> Option<Erased>

Pop a type-erased message from the stack, if non-empty

Source

fn try_pop<M: Debug + 'static>(&mut self) -> Option<M>

Try popping the last message from the stack with the given type

Source

fn try_peek<M: Debug + 'static>(&self) -> Option<&M>

Try observing the last message on the stack without popping

Source

fn peek_debug(&self) -> Option<&dyn Debug>

Debug the last message on the stack, 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.

Implementors§