Struct laminar::ConnectionManager[][src]

pub struct ConnectionManager<TSocket: DatagramSocket, TConnection: Connection> { /* fields omitted */ }

Implements a concept of connections on top of datagram socket. Connection capabilities depends on what is an actual Connection type. Connection type also defines a type of sending and receiving events.

Implementations

impl<TSocket: DatagramSocket, TConnection: Connection> ConnectionManager<TSocket, TConnection>[src]

pub fn new(socket: TSocket, config: Config) -> Self[src]

Creates an instance of ConnectionManager by passing a socket and config.

pub fn manual_poll(&mut self, time: Instant)[src]

Processes any inbound/outbound packets and events. Processes connection specific logic for active connections. Removes dropped connections from active connections list.

pub fn event_sender(&self) -> &Sender<TConnection::SendEvent>[src]

Returns a handle to the event sender which provides a thread-safe way to enqueue user events to be processed. This should be used when the socket is busy running its polling loop in a separate thread.

pub fn event_receiver(&self) -> &Receiver<TConnection::ReceiveEvent>[src]

Returns a handle to the event receiver which provides a thread-safe way to retrieve events from the connections. This should be used when the socket is busy running its polling loop in a separate thread.

pub fn socket(&self) -> &TSocket[src]

Returns socket reference.

pub fn socket_mut(&mut self) -> &mut TSocket[src]

Returns socket mutable reference.

Trait Implementations

impl<TSocket: Debug + DatagramSocket, TConnection: Debug + Connection> Debug for ConnectionManager<TSocket, TConnection> where
    TConnection::SendEvent: Debug,
    TConnection::ReceiveEvent: Debug,
    TConnection::ReceiveEvent: Debug,
    TConnection::SendEvent: Debug
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<TSocket, TConnection> RefUnwindSafe for ConnectionManager<TSocket, TConnection> where
    TConnection: RefUnwindSafe,
    TSocket: RefUnwindSafe

impl<TSocket, TConnection> Send for ConnectionManager<TSocket, TConnection> where
    TConnection: Send,
    TSocket: Send,
    <TConnection as Connection>::ReceiveEvent: Send,
    <TConnection as Connection>::SendEvent: Send

impl<TSocket, TConnection> Sync for ConnectionManager<TSocket, TConnection> where
    TConnection: Sync,
    TSocket: Sync,
    <TConnection as Connection>::ReceiveEvent: Send,
    <TConnection as Connection>::SendEvent: Send

impl<TSocket, TConnection> Unpin for ConnectionManager<TSocket, TConnection> where
    TConnection: Unpin,
    TSocket: Unpin,
    <TConnection as Connection>::ReceiveEvent: Unpin,
    <TConnection as Connection>::SendEvent: Unpin

impl<TSocket, TConnection> UnwindSafe for ConnectionManager<TSocket, TConnection> where
    TConnection: UnwindSafe,
    TSocket: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V