pub struct TimeoutState { /* private fields */ }
Expand description
State for timeouts, especially tailored toward uploading files. But can be useful in any case where the size of an operation in bytes is known.
Implementations§
Source§impl TimeoutState
impl TimeoutState
pub fn new(cfg: AlgorithmConfig, specific: SpecificTimings) -> TimeoutState
Trait Implementations§
Source§impl Timeout for TimeoutState
impl Timeout for TimeoutState
Source§fn get_estimate(&self) -> f64
fn get_estimate(&self) -> f64
Not used by algorithm
Source§fn get_timeout(&self, size: usize, retries: usize) -> Duration
fn get_timeout(&self, size: usize, retries: usize) -> Duration
Size is in either bytes or objects, depending on the type of requests.
Source§fn update(&mut self, result: &RequestReport)
fn update(&mut self, result: &RequestReport)
Update the internal estimate of the extra timeout per unit of size
Auto Trait Implementations§
impl Freeze for TimeoutState
impl RefUnwindSafe for TimeoutState
impl Send for TimeoutState
impl Sync for TimeoutState
impl Unpin for TimeoutState
impl UnwindSafe for TimeoutState
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> 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.