pub enum Error {
Sqlx(Error),
UnresolvedPlaceholder(UnresolvedPlaceholder),
NothingToSet(NothingToSet),
NothingToInsert(NothingToInsert),
FeatureNotEnabled(&'static str),
}Expand description
Errors from executing a qbrs query against Postgres via sqlx. An enum
rather than a bare sqlx::Error so a qbrs-level misuse is distinguishable
from a driver/database error without string-matching a message.
Variants§
Sqlx(Error)
A real error from Postgres or the sqlx driver: a failed
connection, constraint violation, decode failure, etc.
UnresolvedPlaceholder(UnresolvedPlaceholder)
A prepare!{} placeholder reached execution unresolved: either
Prepared::resolve() found no matching field in Params, or the
query was executed directly instead of through .prepare().
NothingToSet(NothingToSet)
An *Update describing no assignment, or an insert of no rows —
caught where the request-shaped data is read (Assignments::from_row,
.values_all), never at a statement. Here so a handler returning
this crate’s Result can ? on that as readily as on a query.
NothingToInsert(NothingToInsert)
FeatureNotEnabled(&'static str)
A column type is enabled on qbrs but not on qbrs-sqlx, so the
value renders and has nothing to bind it. The two crates carry the
same feature names for exactly this reason — turn it on in both.
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<NothingToInsert> for Error
impl From<NothingToInsert> for Error
Source§fn from(source: NothingToInsert) -> Self
fn from(source: NothingToInsert) -> Self
Source§impl From<NothingToSet> for Error
impl From<NothingToSet> for Error
Source§fn from(source: NothingToSet) -> Self
fn from(source: NothingToSet) -> Self
Source§impl From<UnresolvedPlaceholder> for Error
impl From<UnresolvedPlaceholder> for Error
Source§fn from(source: UnresolvedPlaceholder) -> Self
fn from(source: UnresolvedPlaceholder) -> 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> 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