pub struct RetryingContentSource<'a> { /* private fields */ }Expand description
Wraps a FileContentSource so its transient
arm is retried under the shared policy and its permanent arm is not.
This is the ONE place a content read is retried. The wrapped source has already designed out what it can: it opens once and works from the handle, so there is no check-then-use race of its own making. What is left is a genuinely external race (the file removed, replaced, or locked between the scan and this pass), which is the narrow case retry is for.
A permanent failure is returned on the first attempt, unchanged.
Implementations§
Source§impl<'a> RetryingContentSource<'a>
impl<'a> RetryingContentSource<'a>
Sourcepub fn new(inner: &'a dyn FileContentSource) -> Self
pub fn new(inner: &'a dyn FileContentSource) -> Self
Wrap inner with RetryPolicy::DEFAULT.
Trait Implementations§
Source§impl FileContentSource for RetryingContentSource<'_>
impl FileContentSource for RetryingContentSource<'_>
Source§fn read_prefix(
&self,
path: &str,
max_bytes: u64,
) -> Result<FileContent, ContentError>
fn read_prefix( &self, path: &str, max_bytes: u64, ) -> Result<FileContent, ContentError>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RetryingContentSource<'a>
impl<'a> !Send for RetryingContentSource<'a>
impl<'a> !Sync for RetryingContentSource<'a>
impl<'a> !UnwindSafe for RetryingContentSource<'a>
impl<'a> Freeze for RetryingContentSource<'a>
impl<'a> Unpin for RetryingContentSource<'a>
impl<'a> UnsafeUnpin for RetryingContentSource<'a>
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> 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