Trait relay_server::EnvelopeStack

source ·
pub trait EnvelopeStack: Send + Debug {
    type Error: Debug;

    // Required methods
    fn push(
        &mut self,
        envelope: Box<Envelope>,
    ) -> impl Future<Output = Result<(), Self::Error>>;
    fn peek(
        &mut self,
    ) -> impl Future<Output = Result<Option<&Envelope>, Self::Error>>;
    fn pop(
        &mut self,
    ) -> impl Future<Output = Result<Option<Box<Envelope>>, Self::Error>>;
}
Expand description

A stack-like data structure that holds [Envelope]s.

Required Associated Types§

source

type Error: Debug

The error type that is returned when an error is encountered during reading or writing the EnvelopeStack.

Required Methods§

source

fn push( &mut self, envelope: Box<Envelope>, ) -> impl Future<Output = Result<(), Self::Error>>

Pushes an [Envelope] on top of the stack.

source

fn peek( &mut self, ) -> impl Future<Output = Result<Option<&Envelope>, Self::Error>>

Peeks the [Envelope] on top of the stack.

source

fn pop( &mut self, ) -> impl Future<Output = Result<Option<Box<Envelope>>, Self::Error>>

Pops the [Envelope] on top of the stack.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl EnvelopeStack for SqliteEnvelopeStack

§

type Error = SqliteEnvelopeStackError