Skip to main content

StateError

Enum StateError 

Source
#[non_exhaustive]
pub enum StateError {
Show 23 variants EmptySchemaId, SchemaIdTooLong { max_bytes: usize, }, SchemaIdHasSurroundingWhitespace, SchemaIdContainsControl, ZeroSchemaVersion, InvalidByteLimit { maximum: usize, }, InvalidDepthLimit { maximum: usize, }, TooLarge { kind: DurableStateKind, max_bytes: usize, }, TooDeep { kind: DurableStateKind, max_depth: usize, }, Malformed { kind: DurableStateKind, }, FormatMismatch { kind: DurableStateKind, }, UnsupportedFormatVersion { kind: DurableStateKind, version: u16, }, SchemaMismatch { kind: DurableStateKind, }, NonIncreasingUpgrade { from: StateSchemaVersion, to: StateSchemaVersion, }, NoUpgradePath { kind: DurableStateKind, found: StateSchemaVersion, current: StateSchemaVersion, }, AmbiguousUpgrade { kind: DurableStateKind, from: StateSchemaVersion, }, UpgradeOvershootsCurrent { kind: DurableStateKind, to: StateSchemaVersion, current: StateSchemaVersion, }, UpgradeChainTooLong { kind: DurableStateKind, max_upgrades: usize, }, UpgradeProducedInvalidJson { kind: DurableStateKind, }, UnsupportedSchemaVersion { kind: DurableStateKind, found: StateSchemaVersion, current: StateSchemaVersion, }, InvalidPayload, PayloadNotObject, Codec(StateCodecError),
}
Expand description

Stable, value-redacted durable-state validation failure.

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

EmptySchemaId

A schema identifier was empty.

§

SchemaIdTooLong

A schema identifier exceeded its UTF-8 byte limit.

Fields

§max_bytes: usize

Maximum accepted UTF-8 bytes.

§

SchemaIdHasSurroundingWhitespace

A schema identifier had surrounding whitespace.

§

SchemaIdContainsControl

A schema identifier contained a control character.

§

ZeroSchemaVersion

A schema version was zero.

§

InvalidByteLimit

A configured byte limit was zero or above the durable hard ceiling.

Fields

§maximum: usize

Largest configurable byte limit.

§

InvalidDepthLimit

A configured depth limit was zero or above the durable hard ceiling.

Fields

§maximum: usize

Largest configurable JSON depth.

§

TooLarge

A serialized value exceeded its configured byte limit.

Fields

§kind: DurableStateKind

Durable state category.

§max_bytes: usize

Configured maximum bytes.

§

TooDeep

A serialized value exceeded its configured JSON depth.

Fields

§kind: DurableStateKind

Durable state category.

§max_depth: usize

Configured maximum depth.

§

Malformed

The bytes were not a valid framework envelope.

Fields

§kind: DurableStateKind

Durable state category.

§

FormatMismatch

The envelope belongs to the other durable-state category.

Fields

§kind: DurableStateKind

Expected durable state category.

§

UnsupportedFormatVersion

The framework envelope format version is unsupported.

Fields

§kind: DurableStateKind

Durable state category.

§version: u16

Version observed in durable data.

§

SchemaMismatch

The envelope schema does not match the selected codec.

Fields

§kind: DurableStateKind

Durable state category.

§

NonIncreasingUpgrade

A declared upgrade did not strictly increase the schema version.

Fields

§from: StateSchemaVersion

Version the rejected edge reads.

§to: StateSchemaVersion

Version the rejected edge claims to produce.

§

NoUpgradePath

The codec declares no directed upgrade reaching its current version.

Fields

§kind: DurableStateKind

Durable state category.

§found: StateSchemaVersion

Version the chain stalled at.

§current: StateSchemaVersion

Current version supported by the selected codec.

§

AmbiguousUpgrade

Two declared upgrades leave the same version, so the chain is not deterministic.

Fields

§kind: DurableStateKind

Durable state category.

§from: StateSchemaVersion

Version left by more than one declared upgrade.

§

UpgradeOvershootsCurrent

A declared upgrade produces a version past the codec’s current version.

Fields

§kind: DurableStateKind

Durable state category.

§to: StateSchemaVersion

Version the rejected edge produces.

§current: StateSchemaVersion

Current version supported by the selected codec.

§

UpgradeChainTooLong

The resolved upgrade chain exceeded its bound.

Fields

§kind: DurableStateKind

Durable state category.

§max_upgrades: usize

Most upgrades one decode may apply.

§

UpgradeProducedInvalidJson

A declared upgrade returned bytes that are not valid JSON.

Fields

§kind: DurableStateKind

Durable state category.

§

UnsupportedSchemaVersion

Durable data was produced by a newer application schema.

Fields

§kind: DurableStateKind

Durable state category.

§found: StateSchemaVersion

Version observed in durable data.

§current: StateSchemaVersion

Current version supported by the selected codec.

§

InvalidPayload

The application payload was not valid JSON.

§

PayloadNotObject

The application payload was valid JSON but not an object.

§

Codec(StateCodecError)

The application codec rejected the payload without exposing its value.

Trait Implementations§

Source§

impl Clone for StateError

Source§

fn clone(&self) -> StateError

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 StateError

Source§

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

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

impl Display for StateError

Source§

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

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

impl Eq for StateError

Source§

impl Error for StateError

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 PartialEq for StateError

Source§

fn eq(&self, other: &StateError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StateError

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, 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 = 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.