Skip to main content

StoreError

Enum StoreError 

Source
pub enum StoreError {
Show 17 variants Io(Error), Serde(Error), CannotPublishImport, UnknownStage(String), UnknownSig(String), InvalidTransition(String), UnknownBranch(String), UnknownBlob(String), UnknownBlobRef { namespace: String, key: String, }, UnknownOp(OpId), TransformError(TransformError), Apply(ApplyError), TypeError(Vec<TypeError>), BranchAdvanceBlocked(BranchAdvanceBlocked), Contention { branch: String, attempts: u32, }, ProducerBlocked(ProducerBlocked), BudgetExceeded { session_id: String, cap: u64, spent_after: u64, },
}

Variants§

§

Io(Error)

§

Serde(Error)

§

CannotPublishImport

§

UnknownStage(String)

§

UnknownSig(String)

§

InvalidTransition(String)

§

UnknownBranch(String)

§

UnknownBlob(String)

§

UnknownBlobRef

Fields

§namespace: String
§

UnknownOp(OpId)

§

TransformError(TransformError)

A typed AST transform (#280) — e.g. ReplaceMatchArm — was asked to operate on a node it couldn’t address (wrong kind, out-of-range arm index, unknown NodeId, etc.). Distinct from TypeError (which means the transform succeeded but its output didn’t typecheck) so callers can render the right error message.

§

Apply(ApplyError)

§

TypeError(Vec<TypeError>)

The candidate program — i.e. the source the caller is publishing — doesn’t typecheck. The branch head is unchanged and no op records are persisted. Issue #130’s “always-valid HEAD” invariant: the gate runs before any side effect, so a type-broken publish leaves no footprint.

§

BranchAdvanceBlocked(BranchAdvanceBlocked)

The op was persisted but a required_attestations rule in policy.json (#245) refused to advance the branch head past it. The op record is durable — re-running with the missing attestations recorded will succeed without re-persisting — but the branch is unchanged. Surfaced as a structured JSON envelope on the HTTP API.

§

Contention

All retry attempts of the CAS branch-head advance failed because another writer kept advancing the same branch (#262). The op record itself is durable in the op log (orphaned), so re-running with backoff would eventually land — return 503 Contention { retry_after } from the HTTP API and let the client back off.

Fields

§branch: String
§attempts: u32
§

ProducerBlocked(ProducerBlocked)

The op was persisted but its stage carries an attestation produced by a retroactively quarantined tool (#248). The branch head is unchanged. The op record stays in the log (audit trail intact); re-running with the producer unblocked, or with un-contaminated attestations, succeeds without re-persisting the op.

§

BudgetExceeded

The op would push its session’s monotonic budget over the cap configured in policy.session_budgets (#292 slice 3). The op is not persisted; the branch head is unchanged. The caller should either start a new session, raise the cap, or refactor to fit the budget. HTTP API maps to 503.

Fields

§session_id: String
§cap: u64
§spent_after: u64

Trait Implementations§

Source§

impl Debug for StoreError

Source§

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

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

impl Display for StoreError

Source§

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

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

impl Error for StoreError

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<ApplyError> for StoreError

Source§

fn from(source: ApplyError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for StoreError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for StoreError

Source§

fn from(source: Error) -> Self

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.