12
crates/crunch-traits/src/transport.rs
Normal file
12
crates/crunch-traits/src/transport.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::{errors::TransportError, EventInfo};
|
||||
|
||||
#[async_trait]
|
||||
pub trait Transport {
|
||||
async fn publish(&self, event_info: &EventInfo, content: Vec<u8>)
|
||||
-> Result<(), TransportError>;
|
||||
}
|
||||
pub type DynTransport = Arc<dyn Transport + Send + Sync + 'static>;
|
Reference in New Issue
Block a user