Skip to main content

UdpSessionFactory

Trait UdpSessionFactory 

Source
pub trait UdpSessionFactory:
    Send
    + Sync
    + 'static {
    // Required method
    fn open(&self, listener: &ListenerInfo) -> Box<dyn UdpSession>;
}
Available on crate feature udp only.
Expand description

Makes the UdpSession of each UDP listener; any Fn(&ListenerInfo) -> impl UdpSession is one.

Required Methods§

Source

fn open(&self, listener: &ListenerInfo) -> Box<dyn UdpSession>

The session for this listener.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, S> UdpSessionFactory for F
where F: Fn(&ListenerInfo) -> S + Send + Sync + 'static, S: UdpSession,