Skip to main content

UdpProvider

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl UdpProvider for AsyncStd

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

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 feature async-std and (crate features native-tls or rustls) only.
Source§

impl UdpProvider for AsyncStdRustlsRuntime

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

impl UdpProvider for PreferredRuntime

Source§

impl UdpProvider for SmolNativeTlsRuntime

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

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

Source§

impl UdpProvider for SmolRustlsRuntime

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

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

Source§

impl UdpProvider for TokioNativeTlsRuntime

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

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

Source§

impl UdpProvider for TokioRustlsRuntime

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

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

Source§

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