pub struct EndpointConfig {
    pub channel_count: usize,
    pub max_send_rate: usize,
    pub max_receive_rate: usize,
    pub max_packet_size: usize,
    pub max_receive_alloc: usize,
}
Expand description

Parameters used to configure either endpoint of a uflow connection.

Fields

channel_count: usize

The number of channels used to send packets.

Must be greater than 0, and less than or equal to MAX_CHANNELS.

Note: The number of channels used by an endpoint to send data may differ from the opposing endpoint.

max_send_rate: usize

The maximum send rate, in bytes per second. The endpoint will ensure that its outgoing bandwidth does not exceed this value.

Must be greater than 0. Values larger than 2^32 will be truncated.

max_receive_rate: usize

The maximum acceptable receive rate, in bytes per second. The opposing endpoint will ensure that its outgoing bandwidth does not exceed this value.

Must be greater than 0. Values larger than 2^32 will be truncated.

max_packet_size: usize

The maximum size of a sent packet, in bytes. The endpoint will ensure that it does not send packets with a size exceeding this value.

Must be greater than 0, and less than or equal to MAX_PACKET_SIZE.

max_receive_alloc: usize

The maximum allocation size of the endpoint’s receive buffer, in bytes. The endpoint will ensure that the total amount of memory allocated to receive packet data doesn’t exceed this value, rounded up to the nearest multiple of MAX_FRAGMENT_SIZE.

Must be greater than 0.

Note: The maximum allocation size necessarily constrains the maximum receivable packet size. A connection attempt will fail if the max_packet_size of the opposing endpoint exceeds this value.

Implementations

Sets channel_count to the provided value.

Sets max_send_rate to the provided value.

Sets max_receive_rate to the provided value.

Sets max_receive_alloc to the provided value.

Returns true if each parameter has a valid value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Creates an endpoint configuration with the following parameters:

  • Number of channels: 1
  • Maximum outgoing bandwidth: 10MB/s
  • Maximum incoming bandwidth: 10MB/s
  • Maximum receive allocation: 1MB

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.