pub struct SpeedLimits {
pub max_recv_speed: Option<u64>,
pub max_send_speed: Option<u64>,
pub low_speed_limit: Option<u32>,
pub low_speed_time: Option<Duration>,
}Expand description
Configuration for transfer speed limits.
Bundles the four speed-related options into a single struct to avoid passing them as individual parameters.
Fields§
§max_recv_speed: Option<u64>Maximum download speed in bytes/sec. None means unlimited.
max_send_speed: Option<u64>Maximum upload speed in bytes/sec. None means unlimited.
low_speed_limit: Option<u32>Minimum transfer speed in bytes/sec. If the speed drops below
this threshold for low_speed_time, the transfer is aborted.
low_speed_time: Option<Duration>Time window for minimum speed enforcement. The transfer is
aborted if speed stays below low_speed_limit for this duration.
Implementations§
Source§impl SpeedLimits
impl SpeedLimits
Sourcepub const fn has_limits(&self) -> bool
pub const fn has_limits(&self) -> bool
Returns true if any speed limit is configured.
Trait Implementations§
Source§impl Clone for SpeedLimits
impl Clone for SpeedLimits
Source§fn clone(&self) -> SpeedLimits
fn clone(&self) -> SpeedLimits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpeedLimits
impl Debug for SpeedLimits
Source§impl Default for SpeedLimits
impl Default for SpeedLimits
Source§fn default() -> SpeedLimits
fn default() -> SpeedLimits
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpeedLimits
impl RefUnwindSafe for SpeedLimits
impl Send for SpeedLimits
impl Sync for SpeedLimits
impl Unpin for SpeedLimits
impl UnsafeUnpin for SpeedLimits
impl UnwindSafe for SpeedLimits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more