use std::{pin::Pin, sync::Arc}; use async_trait::async_trait; use crate::{errors::TransportError, EventInfo}; #[async_trait] pub trait Transport { type Stream: futures::Stream>; async fn publish(&self, event_info: &EventInfo, content: Vec) -> Result<(), TransportError>; async fn subscriber( &self, event_info: &EventInfo, ) -> Result, TransportError>; } pub type DynTransport = Arc< dyn Transport> + Send>>> + Send + Sync + 'static, >;