[−][src]Struct sudoku_backend::ops::errors::GenericError
Use this for most non-specific errors.
Refer to doc/errors.md
for more details.
Examples
#[get("/endpoint")] fn endpoint() -> Result<String, Json<GenericError>> { work().map_err(|e| Json(GenericError { reason: format!("couldn't finish work: {}", e).into(), severity: GenericErrorSeverity::Warning, })) } fn main() { rocket::ignite() .mount("/", routes![endpoint]) .launch(); }
Fields
reason: Cow<'static, str>
In all-lowercase past-tense finishing-punctuation-free form.
For example: "failed to apply diff", "user with that name exists".
severity: GenericErrorSeverity
How bad the error is.
Trait Implementations
impl PartialEq<GenericError> for GenericError
[src]
impl PartialEq<GenericError> for GenericError
fn eq(&self, other: &GenericError) -> bool
[src]
fn eq(&self, other: &GenericError) -> bool
fn ne(&self, other: &GenericError) -> bool
[src]
fn ne(&self, other: &GenericError) -> bool
impl Clone for GenericError
[src]
impl Clone for GenericError
fn clone(&self) -> GenericError
[src]
fn clone(&self) -> GenericError
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<R: Into<Cow<'static, str>>> From<(R, GenericErrorSeverity)> for GenericError
[src]
impl<R: Into<Cow<'static, str>>> From<(R, GenericErrorSeverity)> for GenericError
fn from((r, s): (R, GenericErrorSeverity)) -> GenericError
[src]
fn from((r, s): (R, GenericErrorSeverity)) -> GenericError
impl Ord for GenericError
[src]
impl Ord for GenericError
fn cmp(&self, other: &GenericError) -> Ordering
[src]
fn cmp(&self, other: &GenericError) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
1.21.0
[src]Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0
[src]Compares and returns the minimum of two values. Read more
impl Eq for GenericError
[src]
impl Eq for GenericError
impl PartialOrd<GenericError> for GenericError
[src]
impl PartialOrd<GenericError> for GenericError
fn partial_cmp(&self, other: &GenericError) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &GenericError) -> Option<Ordering>
fn lt(&self, other: &GenericError) -> bool
[src]
fn lt(&self, other: &GenericError) -> bool
fn le(&self, other: &GenericError) -> bool
[src]
fn le(&self, other: &GenericError) -> bool
fn gt(&self, other: &GenericError) -> bool
[src]
fn gt(&self, other: &GenericError) -> bool
fn ge(&self, other: &GenericError) -> bool
[src]
fn ge(&self, other: &GenericError) -> bool
impl Debug for GenericError
[src]
impl Debug for GenericError
impl Hash for GenericError
[src]
impl Hash for GenericError
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl Serialize for GenericError
[src]
impl Serialize for GenericError
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
impl<'de> Deserialize<'de> for GenericError
[src]
impl<'de> Deserialize<'de> for GenericError
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for GenericError
impl Send for GenericError
impl Sync for GenericError
impl Sync for GenericError
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<T> Typeable for T where
T: Any,
[src]
impl<T> Typeable for T where
T: Any,
impl<T> IntoSql for T
[src]
impl<T> IntoSql for T
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Convert self
to an expression for Diesel's query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel's query builder. Read more