Transport

Trait Transport 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn stats(&self) -> TransportStats

Get transport statistics.

Source

fn name(&self) -> &str

Get transport name for logging.

Implementors§