Skip to main content

UdpService

Trait UdpService 

Source
pub trait UdpService:
    Send
    + Sync
    + 'static {
    // Required method
    fn endpoint(&self, info: &UdpInfo) -> Box<dyn Endpoint>;
}
Expand description

Creates the per-loop Endpoint of a UDP binding. On Linux every loop gets its own SO_REUSEPORT socket and endpoint; elsewhere only loop 0 does.

Required Methods§

Source

fn endpoint(&self, info: &UdpInfo) -> Box<dyn Endpoint>

Returns the endpoint for one loop.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> UdpService for F
where F: Fn(&UdpInfo) -> Box<dyn Endpoint> + Send + Sync + 'static,