use futures::{channel::mpsc, SinkExt};
use tower::BoxError;
use super::Frame;
pub struct FrameOutbox(mpsc::Sender<Frame>);
impl FrameOutbox {
pub async fn send(&mut self, frame: impl Into<Frame>) -> Result<(), BoxError> {
self.0.send(frame.into()).await.map_err(Into::into)
}
pub fn new(tx: mpsc::Sender<Frame>) -> Self {
Self(tx)
}
}