pub struct Failed {
pub status: Status,
pub message: String,
pub feature: Option<String>,
pub offset: Option<u32>,
}Expand description
Why a command did not succeed.
Fields§
§status: StatusWhich class of failure it is, as the driver names them.
message: StringWhat went wrong, in a sentence.
feature: Option<String>The construct the engine has not built, when the status is unsupported.
offset: Option<u32>Where in the statement, when the failure knows.
Implementations§
Source§impl Failed
impl Failed
Sourcepub fn said(status: Status, message: impl Into<String>) -> Failed
pub fn said(status: Status, message: impl Into<String>) -> Failed
Builds a failure of a given class.
@param status - the class @param message - what went wrong
Sourcepub fn misuse(message: impl Into<String>) -> Failed
pub fn misuse(message: impl Into<String>) -> Failed
Builds the failure a caller’s own mistake deserves.
@param message - what was wrong with the request
Sourcepub fn unsupported(
feature: impl Into<String>,
message: impl Into<String>,
) -> Failed
pub fn unsupported( feature: impl Into<String>, message: impl Into<String>, ) -> Failed
Builds the failure for something this engine has not built.
@param feature - the construct, named so a caller can act on it @param message - the sentence to show
Sourcepub fn from_engine(error: &DbError) -> Failed
pub fn from_engine(error: &DbError) -> Failed
Classifies an engine error the way the driver does.
The classification is the driver’s, called rather than copied. There
is exactly one place in this repository that decides whether a refusal
is unsupported or syntax, and a second copy of that decision here
would drift the first time the engine grew a construct.
@param error - the engine’s error
Sourcepub fn from_shell(failure: &Failure) -> Failed
pub fn from_shell(failure: &Failure) -> Failed
Classifies a shell failure, which may or may not carry the engine’s error.
@param failure - what the shell reported
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Failed
impl RefUnwindSafe for Failed
impl Send for Failed
impl Sync for Failed
impl Unpin for Failed
impl UnsafeUnpin for Failed
impl UnwindSafe for Failed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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