use futures::channel::mpsc::{SendError, Sender};
use futures::sink::SinkExt;
use pipecrab_core::{DataFrame, Direction, SystemFrame};
pub struct Outbound {
pub data: Sender<DataFrame>,
pub sys: Sender<(Direction, SystemFrame)>,
}
impl Outbound {
pub async fn send_data(&self, frame: DataFrame) -> Result<(), SendError> {
self.data.clone().send(frame).await
}
pub async fn send_system(&self, dir: Direction, frame: SystemFrame) -> Result<(), SendError> {
self.sys.clone().send((dir, frame)).await
}
}