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§
sourcetype Error: Debug
type Error: Debug
The error type that is returned when an error is encountered during reading or writing the
EnvelopeStack
.
Required Methods§
sourcefn push(
&mut self,
envelope: Box<Envelope>,
) -> impl Future<Output = Result<(), Self::Error>>
fn push( &mut self, envelope: Box<Envelope>, ) -> impl Future<Output = Result<(), Self::Error>>
Pushes an [Envelope
] on top of the stack.
Object Safety§
This trait is not object safe.