Skip to main content

SocketMapStateSpec

Trait SocketMapStateSpec 

Source
pub trait SocketMapStateSpec {
    type AddrVecTag: Eq + Copy + Debug + 'static;
    type ListenerId: Clone + Debug;
    type ConnId: Clone + Debug;
    type ListenerSharingState: Clone + Debug;
    type ConnSharingState: Clone + Debug;
    type ListenerAddrState: SocketMapAddrStateSpec<Id = Self::ListenerId, SharingState = Self::ListenerSharingState> + Debug;
    type ConnAddrState: SocketMapAddrStateSpec<Id = Self::ConnId, SharingState = Self::ConnSharingState> + Debug;

    // Required methods
    fn listener_tag(
        info: ListenerAddrInfo,
        state: &Self::ListenerAddrState,
    ) -> Self::AddrVecTag;
    fn connected_tag(
        has_device: bool,
        state: &Self::ConnAddrState,
    ) -> Self::AddrVecTag;
}
Expand description

Specifies the types parameters for BoundSocketMap state as a single bundle.

Required Associated Types§

Source

type AddrVecTag: Eq + Copy + Debug + 'static

The tag value of a socket address vector entry.

These values are derived from Self::ListenerAddrState and Self::ConnAddrState.

Source

type ListenerId: Clone + Debug

An identifier for a listening socket.

Source

type ConnId: Clone + Debug

An identifier for a connected socket.

Source

type ListenerSharingState: Clone + Debug

The state stored for a listening socket that is used to determine whether sockets can share an address.

Source

type ConnSharingState: Clone + Debug

The state stored for a connected socket that is used to determine whether sockets can share an address.

Source

type ListenerAddrState: SocketMapAddrStateSpec<Id = Self::ListenerId, SharingState = Self::ListenerSharingState> + Debug

The state stored for a listener socket address.

Source

type ConnAddrState: SocketMapAddrStateSpec<Id = Self::ConnId, SharingState = Self::ConnSharingState> + Debug

The state stored for a connected socket address.

Required Methods§

Source

fn listener_tag( info: ListenerAddrInfo, state: &Self::ListenerAddrState, ) -> Self::AddrVecTag

Returns a the tag for a listener in the socket map.

Source

fn connected_tag( has_device: bool, state: &Self::ConnAddrState, ) -> Self::AddrVecTag

Returns a the tag for a connected socket in the socket map.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§