relay_server/services/buffer/envelope_stack/
mod.rsuse std::future::Future;
use chrono::{DateTime, Utc};
use crate::envelope::Envelope;
pub mod caching;
pub mod memory;
pub mod sqlite;
pub trait EnvelopeStack: Send + std::fmt::Debug {
type Error: std::fmt::Debug + std::error::Error;
fn push(&mut self, envelope: Box<Envelope>) -> impl Future<Output = Result<(), Self::Error>>;
fn peek(&mut self) -> impl Future<Output = Result<Option<DateTime<Utc>>, Self::Error>>;
fn pop(&mut self) -> impl Future<Output = Result<Option<Box<Envelope>>, Self::Error>>;
fn flush(self) -> impl Future<Output = ()>;
}