Skip to main content

DatagramRelaySource

Trait DatagramRelaySource 

pub trait DatagramRelaySource<T>: Send {
    // Required method
    fn next_event(
        &mut self,
        receiver: &mut DatagramRelayReader<'_, T>,
        in_capsule: bool,
    ) -> impl Future<Output = Result<Option<SessionEvent>, SessionError>> + Send;
}
Available on crate features http and std only.
Expand description

A source of events for one forwarding direction. Implement this to select or replace protocol data while the relay owns framing, writes and shutdown. Return original events to preserve their delivery semantics. For generated datagrams, DatagramTransport::Native selects native delivery when negotiated, falling back to a DATAGRAM capsule on a capsule-only hop.

Required Methods§

fn next_event( &mut self, receiver: &mut DatagramRelayReader<'_, T>, in_capsule: bool, ) -> impl Future<Output = Result<Option<SessionEvent>, SessionError>> + Send

Return the next event for the opposite hop. While a streamed capsule value is in progress, return only its chunks.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§