Skip to main content

ProjectionError

Enum ProjectionError 

Source
#[non_exhaustive]
pub enum ProjectionError { CursorCodec(String), ProviderManifestMismatch { expected: String, actual: String, }, InvalidConfig { setting: &'static str, reason: String, }, AlreadyRunning { projection_id: ProjectionId, }, Fenced { projection_id: ProjectionId, attempted_generation: u64, current_generation: u64, }, UnexpectedPosition { projection_id: ProjectionId, expected: Option<String>, actual: Option<String>, }, GenerationExhausted { projection_id: ProjectionId, }, Source(String), Handler(String), OffsetStore(String), Runtime(String), TestKitTimeout { timeout_ms: u64, }, }
Expand description

Projection infrastructure failures.

Fatal errors are deterministic configuration, durable-data, or ownership violations. They bypass restart backoff. Restartable errors are transient source and offset-store failures. ProjectionError::Handler records an error returned by a handler or handler factory, but handler-invocation errors first follow super::RecoveryStrategy; only an exhausted invocation escalates to projection restart. The D9 fatal/restartable split governs infrastructure errors directly.

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

CursorCodec(String)

A durable cursor could not be decoded or was not canonically encoded.

§

ProviderManifestMismatch

A cursor belongs to a different source-provider identity.

Fields

§expected: String

Manifest required by the configured source provider.

§actual: String

Manifest stored with the durable cursor.

§

InvalidConfig

Projection configuration is deterministically invalid.

Fields

§setting: &'static str

Setting or identity component that failed validation.

§reason: String

Human-readable validation failure.

§

AlreadyRunning

A second in-process owner attempted to spawn the same projection id.

Fields

§projection_id: ProjectionId

Projection identity already reserved by a live actor.

§

Fenced

An offset-store write used an owner generation superseded by a claimant.

Fields

§projection_id: ProjectionId

Projection whose store ownership was lost.

§attempted_generation: u64

Generation carried by the rejected operation.

§current_generation: u64

Generation currently recorded by the store.

§

UnexpectedPosition

A compare-and-set save observed a different cursor position.

Fields

§projection_id: ProjectionId

Projection whose cursor changed unexpectedly.

§expected: Option<String>

Position the caller previously loaded, or None for no cursor.

§actual: Option<String>

Position present at the save linearization point.

§

GenerationExhausted

A projection generation reached its durable numeric limit.

Fields

§projection_id: ProjectionId

Projection whose generation cannot advance.

§

Source(String)

A projection source failed while being created or consumed.

§

Handler(String)

A handler invocation or handler factory failed.

Runtime code routes this through RecoveryStrategy before considering projection restart, regardless of this variant’s infrastructure kind.

§

OffsetStore(String)

Offset-store I/O failed or its result is uncertain.

§

Runtime(String)

The Ractor shell or its bounded execution bridge failed.

§

TestKitTimeout

A projection-testkit assertion did not pass within its bounded window.

Fields

§timeout_ms: u64

Configured assertion window in milliseconds.

Implementations§

Source§

impl ProjectionError

Source

pub const fn kind(&self) -> ProjectionErrorKind

Returns the D9 fatal-versus-restartable classification.

Source

pub const fn is_fatal(&self) -> bool

Returns whether this error must stop without entering restart backoff.

Source

pub const fn is_restartable(&self) -> bool

Returns whether this error may restart the projection under backoff.

Trait Implementations§

Source§

impl Clone for ProjectionError

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 ProjectionError

Source§

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

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

impl Display for ProjectionError

Source§

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

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

impl Eq for ProjectionError

Source§

impl Error for ProjectionError

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

Source§

fn eq(&self, other: &Self) -> 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 ProjectionError

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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<S> IntoEventHandlerResult<S> for S

Source§

fn into_event_handler_result(self) -> Result<S, PersistenceError>

Converts this handler output into the runtime result.
Source§

impl<T> Message for T
where T: Any + Send + 'static,

Source§

fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>

Convert a BoxedMessage to this concrete type
Source§

fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>

Convert this message to a BoxedMessage
Source§

impl<T> OutputMessage for T
where T: Message + Clone,

Source§

impl<T> State for T
where T: Any + Send + 'static,

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