pub struct CompressedBincodeChannel { /* private fields */ }
Expand description

Wraps a ReliableMessageChannel and reliably sends a single message type serialized with bincode and compressed with snap.

Messages are written in large blocks to aid compression. Messages are serialized end to end, and when a block reaches the maximum configured size (or flush is called), the block is compressed and sent as a single message.

This saves space from the compression and also from the reduced message header overhead per individual message.

Implementations

The max_chunk_len parameter describes the maximum buffer size of a combined message block before it is automatically sent.

An individual message may be no more than max_chunk_len in length.

Send the given message.

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 the current block of messages, compressing them and sending them over the reliable channel.

This method is cancel safe.

Receive a message.

This method is cancel safe, it will never partially receive a message and will never drop a received message.

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.