Struct uflow::Peer

source · []
pub struct Peer { /* private fields */ }
Expand description

An object representing a connection to a remote host.

Connection States

Implementations

Enqueues a packet for delivery to the remote host. The packet will be sent on the given channel according to the specified mode.

Panics

This function will panic if channel_id does not refer to a valid channel, or if data.len() exceeds the maximum packet size.

Delivers all available events for this connection. See Event for a list of possible event types.

Note 1: All events are considered delivered even if the iterator is not consumed until the end.

Note 2: Packets that have been received will not be acknowledged until this function is called. The number of packets that may be queued prior to being delivered is limited by a maximum transfer window, and by the maximum receive allocation.

Terminates the connection, notifying the remote host. If currently connected, all pending packets will be sent prior to disconnecting.

A Disconnect event will be generated if a connection was previously established.

Immediately terminates the connection, without notifying the remote host.

A Disconnect event will be generated if a connection was previously established.

Returns the address of the remote host.

Returns the current round-trip time estimate (RTT), in seconds.

If an RTT estimate has not yet been computed, None is returned instead.

Returns true if the connection has been terminated or timed out.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.