Skip to main content

EngineError

Enum EngineError 

Source
#[non_exhaustive]
pub enum EngineError {
Show 14 variants NoRuntime { lang: String, fn_hash: String, }, UndeclaredInput { fn_name: String, }, Cycle { cell_id: String, }, DepthExceeded { limit: usize, }, BudgetExceeded { fuel: u64, }, WorkExceeded { limit: u64, }, NameUnresolved { fn_name: String, asof: String, }, Store(StoreError), Runtime { cell_id: String, message: String, }, BlobUnavailable { sha256: String, reason: String, }, Invalid(Error), Unlicensed { cell_id: String, reason: LicenceReason, }, NamespaceSuspended { host: String, suspended_at: String, }, Sign(Error),
}
Expand description

What Engine::get can fail with. For how each maps to a response envelope, see the crate documentation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NoRuntime

No runtime is configured for a function’s code.lang.

Fields

§lang: String

The language.

§fn_hash: String

The function’s hash.

§

UndeclaredInput

A function read a function its descriptor does not declare in inputs.

Fields

§fn_name: String

The fully qualified name read.

§

Cycle

A cell depends on itself.

Fields

§cell_id: String

The cell that reappeared on the evaluation stack.

§

DepthExceeded

The evaluation stack reached the depth limit.

Fields

§limit: usize

The limit.

§

BudgetExceeded

The request’s fuel ran out: its normative fuel (SPEC 15.12) exceeds the limit. Nothing was stored for the request.

Fields

§fuel: u64

The fuel the request had.

§

WorkExceeded

The request’s work ran out: every evaluation attempt (those a restart discarded included) and the engine’s validation reads, which bound its total cost beyond the normative fuel (EngineBuilder::work_limit). Nothing was stored for the request. Since 0.3.0.

Fields

§limit: u64

The work limit.

§

NameUnresolved

An input’s function name has no binding as of the request’s asof.

Fields

§fn_name: String

The fully qualified name.

§asof: String

The asof.

§

Store(StoreError)

The store failed.

§

Runtime

A runtime failed, or broke its contract (returned a value of another type than the function declares, or Suspended without a pending input).

Fields

§cell_id: String

The cell being evaluated.

§message: String

What happened.

§

BlobUnavailable

A function read a blob whose content the engine could not obtain or check (SPEC 15.7, 15.12: E_FORMULA_BLOB_UNAVAILABLE, the evaluator’s failure). Nothing was stored for the request. Since 0.3.2.

Fields

§sha256: String

The blob’s SHA-256.

§reason: String

Why: no content, or content of another length or hash.

§

Invalid(Error)

The request is malformed: an asof that is not an instant, a slice, arguments that do not match the function’s signature; or a runtime read such an input. The core’s error carries the code (E_CANON_INSTANT, E_SLICE, E_ARG_UNKNOWN, …). Added to the brief’s list.

§

Unlicensed

The mesh may not compute the cell under licence inheritance (SPEC 8.5, spec-0.4.3): its input licences have no licence in common (share_alike_conflict, restricted_conflict), or a restricted input licence is not declared for the function by its publisher, open at the receipt’s issued (not_declared, declaration_not_open). Nothing was signed or stored for the request. cell_id is the refused cell: the requested one, or a cell it reads (a reader of a refused cell is refused too). The HTTP layer answers unlicensed (403, no new code). Since 0.4.1.

Fields

§cell_id: String

The cell the rule refused.

§reason: LicenceReason

Why (never one of the reasons that give a licence).

§

NamespaceSuspended

A write the engine makes is under a suspended namespace (SPEC 9.9, store 0.4.1): the store refused it with datumesh_store::Error::NamespaceSuspended, as the mesh’s own namespace (the signer of its computed receipts) is suspended. Nothing was signed or stored for the request; reads, verification and the receipts already stored go on. Since 0.4.2.

Fields

§host: String

The suspended host.

§suspended_at: String

When it was suspended (an instant).

§

Sign(Error)

A computed receipt could not be signed: the core refused its members. In practice an input whose asof is later than the engine’s clock (E_TIME_ORDER: asof <= issued). Added to the brief’s list.

Trait Implementations§

Source§

impl Clone for EngineError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EngineError

Source§

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

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

impl Display for EngineError

Source§

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

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

impl Error for EngineError

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

Source§

fn from(e: StoreError) -> EngineError

A store’s refusal of a write under a suspended namespace (SPEC 9.9) is EngineError::NamespaceSuspended; any other store failure is EngineError::Store.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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