pub struct RetryingChunkGet<G, S> { /* private fields */ }Expand description
ChunkGet decorator that retries transient get failures with capped
exponential backoff and jitter, sleeping through an injected Sleeper.
Retries on any error since the inner error type is opaque here; a genuinely
unretrievable chunk still fails, but only after the attempt budget is spent.
put and has delegate to the inner store untouched. Clone is cheap when
G and S are.
Implementations§
Source§impl<G, S> RetryingChunkGet<G, S>
impl<G, S> RetryingChunkGet<G, S>
Sourcepub const fn new(inner: G, sleeper: S, config: RetryConfig) -> Self
pub const fn new(inner: G, sleeper: S, config: RetryConfig) -> Self
Wrap inner, sleeping through sleeper, using config.
Sourcepub fn with_default(inner: G, sleeper: S) -> Self
pub fn with_default(inner: G, sleeper: S) -> Self
Wrap inner with RetryConfig::default.
Trait Implementations§
Source§impl<const BS: usize, G: ChunkHas<BS>, S: MaybeSend + MaybeSync> ChunkHas<BS> for RetryingChunkGet<G, S>
impl<const BS: usize, G: ChunkHas<BS>, S: MaybeSend + MaybeSync> ChunkHas<BS> for RetryingChunkGet<G, S>
Source§async fn has(&self, address: &ChunkAddress) -> bool
async fn has(&self, address: &ChunkAddress) -> bool
Check if a chunk exists.
Source§impl<const BS: usize, G: ChunkPut<BS>, S: MaybeSend + MaybeSync> ChunkPut<BS> for RetryingChunkGet<G, S>
impl<const BS: usize, G: ChunkPut<BS>, S: MaybeSend + MaybeSync> ChunkPut<BS> for RetryingChunkGet<G, S>
Auto Trait Implementations§
impl<G, S> Freeze for RetryingChunkGet<G, S>
impl<G, S> RefUnwindSafe for RetryingChunkGet<G, S>where
G: RefUnwindSafe,
S: RefUnwindSafe,
impl<G, S> Send for RetryingChunkGet<G, S>
impl<G, S> Sync for RetryingChunkGet<G, S>
impl<G, S> Unpin for RetryingChunkGet<G, S>
impl<G, S> UnsafeUnpin for RetryingChunkGet<G, S>where
G: UnsafeUnpin,
S: UnsafeUnpin,
impl<G, S> UnwindSafe for RetryingChunkGet<G, S>where
G: UnwindSafe,
S: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, const BODY_SIZE: usize> ChunkGetExt<BODY_SIZE> for Twhere
T: ChunkGet<BODY_SIZE>,
impl<T, const BODY_SIZE: usize> ChunkGetExt<BODY_SIZE> for Twhere
T: ChunkGet<BODY_SIZE>,
Source§impl<T, const BODY_SIZE: usize> ChunkPutExt<BODY_SIZE> for Twhere
T: ChunkPut<BODY_SIZE>,
impl<T, const BODY_SIZE: usize> ChunkPutExt<BODY_SIZE> for Twhere
T: ChunkPut<BODY_SIZE>,
Source§fn write_file<D: ReadAt + Sync>(
&self,
data: D,
) -> impl Future<Output = Result<ChunkAddress>> + MaybeSend
fn write_file<D: ReadAt + Sync>( &self, data: D, ) -> impl Future<Output = Result<ChunkAddress>> + MaybeSend
Split
data and store every produced chunk, returning the root address. Read moreSource§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 more