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]
impl<TSocket: DatagramSocket, TConnection: Connection> ConnectionManager<TSocket, TConnection>
[src]pub fn new(socket: TSocket, config: Config) -> Self
[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]
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]
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]
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_mut(&mut self) -> &mut TSocket
[src]
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]
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]Auto Trait Implementations
impl<TSocket, TConnection> RefUnwindSafe for ConnectionManager<TSocket, TConnection> where
TConnection: RefUnwindSafe,
TSocket: RefUnwindSafe,
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,
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,
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,
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,
TConnection: UnwindSafe,
TSocket: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,