Trait tor_rtcompat::UdpProvider

source ·
pub trait UdpProvider: Clone + Send + Sync + 'static {
    type UdpSocket: UdpSocket + Send + Sync + Unpin + 'static;

    // Required method
    fn bind<'life0, 'life1, 'async_trait>(
        &'life0 self,
        addr: &'life1 SocketAddr
    ) -> Pin<Box<dyn Future<Output = IoResult<Self::UdpSocket>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for a runtime that can send and receive UDP datagrams.

Required Associated Types§

source

type UdpSocket: UdpSocket + Send + Sync + Unpin + 'static

The type of Udp Socket returned by Self::bind()

Required Methods§

source

fn bind<'life0, 'life1, 'async_trait>( &'life0 self, addr: &'life1 SocketAddr ) -> Pin<Box<dyn Future<Output = IoResult<Self::UdpSocket>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bind a local port to send and receive packets from

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl UdpProvider for AsyncStd

Available on (crate features native-tls or rustls) and (crate features async-std or tokio) and crate feature async-std only.
§

type UdpSocket = UdpSocket

source§

fn bind<'life0, 'life1, 'async_trait>( &'life0 self, addr: &'life1 SocketAddr ) -> Pin<Box<dyn Future<Output = IoResult<Self::UdpSocket>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

source§

impl UdpProvider for AsyncStdNativeTlsRuntime

Available on (crate features native-tls or rustls) and crate feature async-std only.
source§

impl UdpProvider for AsyncStdRustlsRuntime

Available on (crate features native-tls or rustls) and crate feature async-std only.
source§

impl UdpProvider for PreferredRuntime

source§

impl UdpProvider for TokioNativeTlsRuntime

Available on (crate features native-tls or rustls) and crate feature tokio only.
§

type UdpSocket = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as UdpProvider>::UdpSocket

source§

impl UdpProvider for TokioRustlsRuntime

Available on (crate features native-tls or rustls) and crate feature tokio only.
§

type UdpSocket = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as UdpProvider>::UdpSocket

source§

impl<SpawnR, SleepR, CoarseTimeR, TcpR, TlsR, UdpR> UdpProvider for CompoundRuntime<SpawnR, SleepR, CoarseTimeR, TcpR, TlsR, UdpR>
where UdpR: UdpProvider + Send + Sync + 'static, SpawnR: Send + Sync + 'static, SleepR: Send + Sync + 'static, CoarseTimeR: Send + Sync + 'static, TcpR: Send + Sync + 'static, TlsR: Send + Sync + 'static,