Struct uflow::EndpointConfig
source · [−]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: usizeThe 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: usizeThe 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: usizeThe 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: usizeThe 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: usizeThe 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
sourceimpl Config
impl Config
sourcepub fn channel_count(self, channel_count: usize) -> Config
pub fn channel_count(self, channel_count: usize) -> Config
Sets channel_count to the provided value.
sourcepub fn max_send_rate(self, rate: usize) -> Config
pub fn max_send_rate(self, rate: usize) -> Config
Sets max_send_rate to the provided value.
sourcepub fn max_receive_rate(self, rate: usize) -> Config
pub fn max_receive_rate(self, rate: usize) -> Config
Sets max_receive_rate to the provided value.
sourcepub fn max_receive_alloc(self, max_receive_alloc: usize) -> Config
pub fn max_receive_alloc(self, max_receive_alloc: usize) -> Config
Sets max_receive_alloc to the provided value.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more