pub struct UnreliableBincodeChannel<R, P> where
    R: Runtime,
    P: PacketPool
{ /* private fields */ }
Expand description

Wraps an UnreliableChannel together with an internal buffer to allow easily sending message types serialized with bincode.

Just like the underlying channel, messages are not guaranteed to arrive, nor are they guaranteed to arrive in order.

Implementations

Create a new UnreliableBincodeChannel with the given max message size.

The maximum message size is always limited by the underlying UnreliableChannel maximum message size regardless of the max_message_len setting, but this can be used to restrict the intermediate buffer used to serialize messages.

Write the given serializable message type to the channel.

Messages are coalesced into larger packets before being sent, so in order to guarantee that the message is actually sent, you must call flush.

This method is cancel safe, it will never partially send a message, though canceling it may or may not buffer a message to be sent.

Finish sending any unsent coalesced packets.

This must be called to guarantee that any sent messages are actually sent to the outgoing packet stream.

This method is cancel safe.

Receive a deserializable message type as soon as the next message is available.

This method is cancel safe, it will never partially read a message or drop received messages.

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.