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
How PostgresProjectionStore
fails.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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.
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
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
impl Debug for PostgresProjectionStoreError
§impl Display for PostgresProjectionStoreError
impl Display for PostgresProjectionStoreError
§impl Error for PostgresProjectionStoreError
impl Error for PostgresProjectionStoreError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
§impl From<Error> for PostgresProjectionStoreError
impl From<Error> for PostgresProjectionStoreError
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresProjectionStoreError
impl !UnwindSafe for PostgresProjectionStoreError
impl Freeze for PostgresProjectionStoreError
impl Send for PostgresProjectionStoreError
impl Sync for PostgresProjectionStoreError
impl Unpin for PostgresProjectionStoreError
impl UnsafeUnpin for PostgresProjectionStoreError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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