pub enum FlozError {
NotFound,
UniqueViolation(String),
ForeignKeyViolation(String),
UnsavedEntity,
MismatchedBulkInsertColumns {
row: usize,
column: String,
},
UnguardedDelete,
UnguardedUpdate,
Database(Error),
Serialization(String),
ValidationError(String),
}Expand description
All errors that can be returned by floz operations.
Variants§
NotFound
Record not found (used by get())
UniqueViolation(String)
Unique constraint violated
ForeignKeyViolation(String)
Foreign key constraint violated
UnsavedEntity
Attempted to save() an entity with default/uninitialized primary key
MismatchedBulkInsertColumns
Bulk insert rows have mismatched column sets
UnguardedDelete
DELETE without .where_() or .all() — safety guard
UnguardedUpdate
UPDATE without .where_() — safety guard
Database(Error)
Underlying database error from sqlx
Serialization(String)
Serialization/deserialization error
ValidationError(String)
Validation error from a lifecycle hook
Trait Implementations§
Source§impl Error for FlozError
impl Error for FlozError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for FlozError
impl !UnwindSafe for FlozError
impl Freeze for FlozError
impl Send for FlozError
impl Sync for FlozError
impl Unpin for FlozError
impl UnsafeUnpin for FlozError
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
Mutably borrows from an owned value. Read more
impl<T> FlozRowBound for 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>
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 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>
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