pub enum Error {
}Variants§
Db(Error)
A connection/pool/decode/server-response failure from the driver.
Compile(PyQLError)
PyQL failed to compile — a syntax/type/resolution/cardinality error.
Decode(DecodeError)
A row didn’t fit the type query::<R, _> was asked to decode it
into — a shape missing a field the struct declares, an enum label
with no matching variant, an integer too wide for its Rust type.
MissingParam(String)
A required query parameter (named or __global__-prefixed) had no
matching entry in the params/globals passed by the caller.
InvalidArgument(String)
An argument the query cannot mean — today only a NULL inside an array, which PyQL has no type for. Carries the wording verbatim so every client reports it the same way.
ResultCardinality
query_single/query_required_single (and their _json siblings)
got more than one row back.
NoData
query_required_single (and its _json sibling) got zero rows.
NoSchemaSnapshot
Neither pylon migration apply nor pylon migration watch has ever
run against this database, so there’s no schema snapshot to load —
a bare schema-file edit has no effect until one of those does.
SchemaJson(Error)
Analyze(String)
EXPLAIN’s raw JSON output failed to correlate against the query’s
own analyze_paths (pylon_core::analyze::build_coarse_grained).
Cache(String)
A pylon_cache::Cache open/get/put failure — that crate’s own
errors are a boxed dyn Error + Send + Sync, not a good match for
thiserror’s #[from]/transparent, so this just carries the
rendered message.
UnknownChannel(String)
Client::listen(name) — no Channel declared in the schema matches
name (bare or module::name).
MalformedPayload(String)
A Client::listen() NOTIFY payload didn’t match its Channel’s own
declared shape (bad JSON, a value that doesn’t parse as its
declared scalar type, a missing Object field, …).
Rollback
Not a failure: a transaction body asking to be rolled back instead
of committed. The Rust counterpart of pylon.Rollback — a body that
wants to write, read its own writes and then leave nothing behind
(a test, a dry run) returns this. It rides in Error because the
body’s return type is Result<T> and there is no T to hand back
on a path that deliberately produced nothing; [Client::transaction_opt]
turns it into Ok(None) for callers who would rather not see an
error at all.
Implementations§
Source§impl Error
impl Error
Sourcepub fn sqlstate(&self) -> Option<&SqlState>
pub fn sqlstate(&self) -> Option<&SqlState>
The Postgres SQLSTATE code, when this wraps a real server response —
None for a compile error or a connection/pool/decode failure.
Sourcepub fn is_serialization_error(&self) -> bool
pub fn is_serialization_error(&self) -> bool
40001 — a serializable/repeatable-read transaction lost a write
skew race. Retriable by re-running the whole transaction body.
Sourcepub fn is_deadlock(&self) -> bool
pub fn is_deadlock(&self) -> bool
40P01 — Postgres broke a deadlock by aborting this transaction.
Retriable the same way a serialization failure is.
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Either of the two conditions the retrying transaction loop
(transaction.rs) automatically retries on.
Sourcepub fn is_rollback(&self) -> bool
pub fn is_rollback(&self) -> bool
A deliberate abort (Error::Rollback) rather than a failure —
worth distinguishing when a caller drives
Client::transaction_with_attempts
directly instead of going through
Client::transaction_opt.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.