pub struct AlgorithmConfig {
pub base_timeout: f64,
pub timeout_fraction: f64,
pub backoff: f64,
pub n_retries: usize,
pub avg_power: f64,
}Fields§
§base_timeout: f64The base timeout which will always be there (an estimate of RTT)
timeout_fraction: f64Timeout is set to a fraction of expected upload time (> 1.0)
backoff: f64Every retry, the timeout is multiplied by backoff (> 1.0)
n_retries: usizeNumber of times to retry a single request before giving up
avg_power: f64To estimate the upload speed incrementally, we use an exponential average:
new_avg_speed = avg_power * new_speed + (1 - avg_power) * avg_speed.
Thus, between 0.0 and 1.0, closer to 1.0 means that newer data points have more significance.
Trait Implementations§
Source§impl Clone for AlgorithmConfig
impl Clone for AlgorithmConfig
Source§fn clone(&self) -> AlgorithmConfig
fn clone(&self) -> AlgorithmConfig
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 AlgorithmConfig
impl Debug for AlgorithmConfig
Source§impl Default for AlgorithmConfig
impl Default for AlgorithmConfig
Source§impl<'de> Deserialize<'de> for AlgorithmConfig
impl<'de> Deserialize<'de> for AlgorithmConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AlgorithmConfig
impl RefUnwindSafe for AlgorithmConfig
impl Send for AlgorithmConfig
impl Sync for AlgorithmConfig
impl Unpin for AlgorithmConfig
impl UnwindSafe for AlgorithmConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.