pub enum ContentError {
TransientRead,
PermanentRead,
NotUtf8,
}Expand description
Why a file could not be turned into an index.
Transient and permanent are separate variants on purpose. This pass re-opens a file AFTER the scan finished, so between the two a file can be deleted, replaced, or briefly locked by another process. That is a different fact from “this file is a directory” or “you may not read it”, and collapsing the two would report a momentary blip as a permanent hole in coverage.
The failure the pass can design out, it does: FilesystemContent opens
once and works from the handle rather than stat-ing a path and then opening
it, so there is no check-then-use race of its own making. What is left is
genuinely external, which is why it is classified rather than looped over.
Retry policy is not decided here; a caller that owns one wraps
FileContentSource and retries only ContentError::TransientRead.
Variants§
TransientRead
The read failed for a reason that may not hold a moment later: the file was removed or replaced after the scan, a lock was held, a syscall was interrupted, or a resource was momentarily busy.
PermanentRead
The read failed for a reason retrying cannot change: permission denied, the path is a directory, or the device rejected it.
NotUtf8
The prefix is not valid UTF-8.
Implementations§
Trait Implementations§
Source§impl Clone for ContentError
impl Clone for ContentError
Source§fn clone(&self) -> ContentError
fn clone(&self) -> ContentError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ContentError
Source§impl Debug for ContentError
impl Debug for ContentError
impl Eq for ContentError
Source§impl PartialEq for ContentError
impl PartialEq for ContentError
impl StructuralPartialEq for ContentError
Auto Trait Implementations§
impl Freeze for ContentError
impl RefUnwindSafe for ContentError
impl Send for ContentError
impl Sync for ContentError
impl Unpin for ContentError
impl UnsafeUnpin for ContentError
impl UnwindSafe for ContentError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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