pub trait Transport:
Send
+ Sync
+ Debug {
// Required methods
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 UdmEvent,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<SendResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn send_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [UdmEvent],
) -> Pin<Box<dyn Future<Output = PhyTraceResult<BatchResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stats(&self) -> TransportStats;
fn name(&self) -> &str;
}Expand description
Transport layer trait for sending events.
Implementations should handle:
- Connection management
- Authentication
- Serialization
- Error handling and retries (optional, can be handled by reliability layer)
Required Methods§
Sourcefn send<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 UdmEvent,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<SendResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 UdmEvent,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<SendResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a single event.
Sourcefn send_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [UdmEvent],
) -> Pin<Box<dyn Future<Output = PhyTraceResult<BatchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [UdmEvent],
) -> Pin<Box<dyn Future<Output = PhyTraceResult<BatchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a batch of events.
Sourcefn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the transport is connected/ready.
Sourcefn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the remote endpoint.
Sourcefn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PhyTraceResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from the remote endpoint.
Sourcefn stats(&self) -> TransportStats
fn stats(&self) -> TransportStats
Get transport statistics.