pub struct LowSpeed {
pub limit: u32,
pub time: Duration,
}Expand description
The lowest transfer rate that a fetch accepts.
The fetcher samples the rate of a transfer once a second. Each sample is the bytes of the last five seconds divided by five. In the first five seconds, a sample is the bytes so far divided by the whole seconds so far.
If the rate stays at limit or less for time without a break, the
transfer fails as a transport failure. A transfer starts under the limit,
because it carried no bytes. A sample over the limit starts the count of
time again. For the response head, the count starts at the start of the
attempt, and for the body, at the first read.
Fields§
§limit: u32The rate in bytes per second that a transfer must keep.
A zero fails Fetcher::new.
time: DurationThe longest time that the rate can stay at limit or less.
A zero fails Fetcher::new. The fetcher samples the rate once a
second, so a part of a second counts as a whole second.
Trait Implementations§
impl Copy for LowSpeed
impl Eq for LowSpeed
impl StructuralPartialEq for LowSpeed
Auto Trait Implementations§
impl Forget for LowSpeed
impl Freeze for LowSpeed
impl Move for LowSpeed
impl RefUnwindSafe for LowSpeed
impl Send for LowSpeed
impl Sync for LowSpeed
impl Unpin for LowSpeed
impl UnsafeUnpin for LowSpeed
impl UnwindSafe for LowSpeed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.