pub enum BlobCacheError {
Show 15 variants
Path(PathTokenError),
Storage(StorageError),
NoCloudHome,
Io(String),
Metadata(DbError),
StorageSetup(String),
ChangesetWalkMismatch {
old_count: usize,
new_count: usize,
},
ExternalMissing {
id: String,
path: PathBuf,
source: String,
},
ExternalSizeMismatch {
id: String,
path: PathBuf,
},
NoLocalCopy {
namespace: String,
id: String,
},
LocalityUnresolved {
id: String,
},
NoExternalRef {
id: String,
},
CloudSizeMismatch {
namespace: String,
id: String,
expected: u64,
actual: u64,
},
CloudHashMismatch {
namespace: String,
id: String,
expected: String,
actual: String,
},
MissingContentHash {
namespace: String,
id: String,
},
}Expand description
Why a blob-cache operation failed.
Variants§
Path(PathTokenError)
A blob id/namespace/cloud_path that can’t form a safe path — bad data
that could escape the store dir or can’t be partitioned. The blob is
refused before any path is built (the same gate the pull runs).
Storage(StorageError)
A cloud read failed: the blob isn’t in the cloud, or the backend errored
(surfaced from [SyncStorage::get_blob]).
NoCloudHome
A Remote blob’s bytes were needed from the cloud but no cloud home is connected, so there is no storage to fetch them from. A home-less store holds only Local blobs (external refs + the local store), which serve straight off disk and never reach the cloud-miss path; reaching here means a Remote blob was read with no provider connected — a real fault, surfaced rather than masked.
Io(String)
A local-disk failure: a cache write, a folder move, or a test cache reset. Carries a human-readable cause.
Metadata(DbError)
A blob-metadata query failed — resolving the blob’s locality, looking up its external ref, or reading its cache budget or expected size. A database read the blob path depends on, distinct from a disk I/O failure.
StorageSetup(String)
Building the sync storage from config failed — missing credentials or cloud configuration — when a Remote blob needed it. A configuration fault, not a disk I/O error.
ChangesetWalkMismatch
The old-value and new-value walks of one changeset disagreed on row count. They are two views of the same changeset; a mismatch means cleanup cannot pair updated rows with their previous blob ids.
ExternalMissing
A registered external blob ref (a user-provided Local blob’s user-owned file) points at a file that is no longer there — the user moved, renamed, or deleted it. Terminal: an external blob has no cloud copy to fall back to, so this never re-fetches. The host surfaces a “files missing / moved” state whose actions are relocate (pick the new folder, re-register) or re-import.
Fields
ExternalSizeMismatch
A registered external blob’s file is present but its length no longer matches
the registered size — the user truncated it or replaced it with a
different-length file. Terminal like Self::ExternalMissing: validate-on-
read is presence + size, and a mismatch is not the bytes coven registered.
NoLocalCopy
A Local blob (its gated locality root’s gate is off) has no copy in the local store. A Local blob has no cloud copy, so there is nothing to fall back to: the state is broken, not a cache miss. Surfaced loud rather than silently fetching from the cloud — a make_local rollback leftover, an interrupted materialize, or a lost local file would otherwise be papered over. The host re-materializes or repairs.
LocalityUnresolved
A blob could not be resolved to a locality: its namespace declares no blob-bearing table, or that table has no row with the id, or the row reaches no gated root or remote root — so the source of Local-vs-Remote truth can’t be read. In a consistent store every readable blob has a locality root, so this is a real fault — surfaced rather than guessing a source by probing.
NoExternalRef
The gate resolved a blob to Local + user-provided, but no external-ref row is registered for it. A user-provided Local blob’s bytes live only at the user’s path, tracked by that ref; its absence is corruption (a lost or never-written ref), not a cache miss to fall through — surfaced loud so the host repairs or re-imports.
CloudSizeMismatch
A Remote blob fetched whole from the cloud came back with a plaintext length that disagrees with the row’s declared size. The bytes are not what the row describes, so they are refused before caching or returning: caching them would fail the read’s own length check on every later read, warning and refetching the same wrong object forever. Terminal like the length checks the cache-hit and file-download paths run.
CloudHashMismatch
A Remote blob fetched from the cloud decrypted to plaintext whose content hash disagrees with the author-signed hash on the blob’s row. The bytes are not the ones the row’s author pinned — a tampered object, a rolled-back prior version, or a same-size object planted under a different uploader’s prefix — so they are refused before caching or returning. The row’s hash is the authority; a mismatch is tamper, never a cache miss to refetch.
MissingContentHash
A blob’s row carries no content hash, so a whole-blob download cannot be verified against the author’s signed value. The hash is a required column, so an absent one is bad data (a row that predates the field, or a NULL where a hash must be), surfaced rather than serving unverified bytes.
Trait Implementations§
Source§impl Debug for BlobCacheError
impl Debug for BlobCacheError
Source§impl Display for BlobCacheError
impl Display for BlobCacheError
Source§impl Error for BlobCacheError
impl Error for BlobCacheError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<LocalBlobError> for BlobCacheError
impl From<LocalBlobError> for BlobCacheError
Source§fn from(e: LocalBlobError) -> BlobCacheError
fn from(e: LocalBlobError) -> BlobCacheError
Source§impl From<PathTokenError> for BlobCacheError
impl From<PathTokenError> for BlobCacheError
Source§fn from(e: PathTokenError) -> BlobCacheError
fn from(e: PathTokenError) -> BlobCacheError
Source§impl From<StorageError> for BlobCacheError
impl From<StorageError> for BlobCacheError
Source§fn from(e: StorageError) -> BlobCacheError
fn from(e: StorageError) -> BlobCacheError
Auto Trait Implementations§
impl Freeze for BlobCacheError
impl RefUnwindSafe for BlobCacheError
impl Send for BlobCacheError
impl Sync for BlobCacheError
impl Unpin for BlobCacheError
impl UnsafeUnpin for BlobCacheError
impl UnwindSafe for BlobCacheError
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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