#[non_exhaustive]pub enum PostgresInboxError {
UnsupportedServerVersion {
required: u32,
detected: u32,
},
NotMigrated {
schema: String,
},
SchemaNotOnSearchPath {
configured: String,
observed: String,
},
NotClaimed {
scope: String,
message_id: MessageId,
},
InvalidSettings {
message: String,
},
Database {
source: Error,
},
}Expand description
A failure of a crate::PostgresInboxStore call (inbox contract §3). Deliberately smaller
than crate::PostgresOutboxError: the inbox has no enqueue/acquire analog, so it needs
no Decode/UnknownMetadataVersion/DuplicateMessage variant, and no InvalidSchema — every
schema value this type ever sees already passed the same identifier validation at migrate()
(the inbox shares the outbox’s schema and its single migrate() entry point, inbox contract §1),
and claim/complete bind it only as set_config data, never interpolate it into DDL.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedServerVersion
The connected server’s server_version_num is below crate::MIN_SERVER_VERSION_NUM
(ADR 0041). Checked at crate::PostgresInboxStore::connect, before the search_path
verification below — the same ordering
crate::PostgresOutboxError::UnsupportedServerVersion uses and for the same reason.
Permanent.
Fields
required: u32crate::MIN_SERVER_VERSION_NUM, restated on the value.
NotMigrated
inbox resolved to the configured schema, but the relation itself is missing —
migrate() has not been run. Permanent. Checked before
Self::SchemaNotOnSearchPath below at crate::PostgresInboxStore::connect, exactly as
crate::PostgresOutboxError::NotMigrated is checked before
crate::PostgresOutboxError::SchemaNotOnSearchPath — a missing relation reported as a
search_path problem would send an operator chasing the wrong fix.
SchemaNotOnSearchPath
The unqualified name inbox does not resolve to the configured schema and the relation
exists somewhere reachable — search_path puts a different schema first. Carries the
configured schema and the observed search_path; the ALTER ROLE remedy is in the
Display text. Permanent.
Fields
configured: StringThe schema crate::PostgresInboxSettings::schema named.
NotClaimed
crate::PostgresInboxStore’s InboxStore::complete matched zero rows — reachable only
by misuse (completing without a preceding Claimed claim, after the claiming
transaction aborted, or completing a row that has since gone dead — complete’s own
guard is completed_at IS NULL AND dead_at IS NULL, ADR 0042 A.2.4). Permanent —
retrying the same call changes nothing.
Fields
InvalidSettings
PostgresInboxSettings::validate rejected the settings — currently only
max_attempts == 0 (ADR 0042 A.2.4). Checked at
crate::PostgresInboxStore::connect, before any query runs. Permanent.
Database
Any other sqlx failure, classified by SQLSTATE exactly as
crate::PostgresOutboxError::Database.
Trait Implementations§
Source§impl Classify for PostgresInboxError
Per-variant classification table, exactly as crate::PostgresOutboxError’s: no blanket
“everything else is transient”.
impl Classify for PostgresInboxError
Per-variant classification table, exactly as crate::PostgresOutboxError’s: no blanket
“everything else is transient”.
Source§fn kind(&self) -> FailureKind
fn kind(&self) -> FailureKind
Source§impl Debug for PostgresInboxError
impl Debug for PostgresInboxError
Source§impl Display for PostgresInboxError
impl Display for PostgresInboxError
Source§impl Error for PostgresInboxError
impl Error for PostgresInboxError
Source§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()
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresInboxError
impl !UnwindSafe for PostgresInboxError
impl Freeze for PostgresInboxError
impl Send for PostgresInboxError
impl Sync for PostgresInboxError
impl Unpin for PostgresInboxError
impl UnsafeUnpin for PostgresInboxError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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