Skip to main content

BlobCacheError

Enum BlobCacheError 

Source
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.

Fields

§old_count: usize
§new_count: usize
§

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

§path: PathBuf
§source: String

The underlying read failure — a missing file or a real I/O error, preserved rather than collapsed so the host sees why the read failed.

§

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.

Fields

§path: PathBuf
§

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.

Fields

§namespace: String
§

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.

Fields

§

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.

Fields

§

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.

Fields

§namespace: String
§expected: u64
§actual: u64
§

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.

Fields

§namespace: String
§expected: String
§actual: String
§

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.

Fields

§namespace: String

Trait Implementations§

Source§

impl Debug for BlobCacheError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for BlobCacheError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Error for BlobCacheError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<LocalBlobError> for BlobCacheError

Source§

fn from(e: LocalBlobError) -> BlobCacheError

Converts to this type from the input type.
Source§

impl From<PathTokenError> for BlobCacheError

Source§

fn from(e: PathTokenError) -> BlobCacheError

Converts to this type from the input type.
Source§

impl From<StorageError> for BlobCacheError

Source§

fn from(e: StorageError) -> BlobCacheError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,