Skip to main content

PostgresProjectionStoreError

Enum PostgresProjectionStoreError 

#[non_exhaustive]
pub enum PostgresProjectionStoreError { Driver(Error), CheckpointOutOfRange { value: i64, }, InvalidAuthority(String), ForeignBatch,
#[non_exhaustive]
ParameterCount { statement: usize, declared: usize, supplied: usize, }, Poisoned, }
Expand description

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

Driver(Error)

The driver, the pool or the server rejected the work.

§

CheckpointOutOfRange

A stored checkpoint was outside the contract’s domain.

Same gap as PostgresEventStoreError::PositionOutOfRange, for the same reason: a checkpoint is a SequencePosition stored in a signed bigint.

Fields

§value: i64

The value as Postgres returned it.

§

InvalidAuthority(String)

A stored checkpoint recorded an authority that is not one of the two Authority variants.

Migration 2 carries a CHECK that makes this unreachable through this adapter, so reaching it means the table was written by something else — which is precisely when a caller wants to be told rather than handed a plausible default. Defaulting to Live would report a half-finished rebuild as a live projection.

§

ForeignBatch

The batch was begun on a different store instance.

CommitError::ForeignBatch and its reset sibling carry this for those two operations; rollback returns the store’s own error type and so needs its own variant. The batch is consumed either way — the refusal is how a caller learns it was holding the wrong one, on the call that was meant to be the cleanup.

A sqlx::Transaction would have been unforgeable and needed no such variant. This adapter’s batch is a buffer, for the reason the module documentation gives, and a buffer is exactly as forgeable as happenstance-sqlite’s — so it carries the same stamp and the same refusal.

§

#[non_exhaustive]
ParameterCount

A statement’s values do not match the placeholders its text uses.

declared is the highest $n in the statement’s text — quoted strings, quoted identifiers, dollar-quoted bodies and comments are skipped — and supplied is how many values were bound beside it. statement is the statement’s zero-based position in the batch: in queue order for a PostgresProjectionBatch, in issue order for a LivePostgresBatch.

Refused before anything is sent (ADR-0084). The server on its own refuses only too few values. A surplus it accepts on a connection that prepares the text for the first time, and the statement it then caches refuses every later correct call of that text on that connection.

The variant is #[non_exhaustive], so a caller matches it with .. and it can gain a field without a break.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§statement: usize

The statement’s zero-based position in the batch.

§declared: usize

The highest $n its text uses.

§supplied: usize

How many values were bound.

§

Poisoned

A statement issued into this live batch was refused before it reached the server, so the batch can only be rolled back.

The server aborts its own transaction on a statement it refuses. It never saw this one, so the adapter marks the batch instead: every later execute, and commit and reset, report this.

Trait Implementations§

§

impl Debug for PostgresProjectionStoreError

§

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

Formats the value using the given formatter. Read more
§

impl Display for PostgresProjectionStoreError

§

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

Formats the value using the given formatter. Read more
§

impl Error for PostgresProjectionStoreError

§

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
§

impl From<Error> for PostgresProjectionStoreError

§

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
§

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,

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

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