Skip to main content

AppError

Struct AppError 

Source
pub struct AppError { /* private fields */ }

Implementations§

Source§

impl AppError

Source

pub fn usage(message: impl Into<String>) -> Self

Source

pub fn data(message: impl Into<String>) -> Self

Source

pub fn runtime(message: impl Into<String>) -> Self

Source

pub fn db(err: Error) -> Self

Source

pub fn db_open(err: impl Display) -> Self

Source

pub fn db_query(err: Error) -> Self

Source

pub fn db_write(err: Error) -> Self

Source

pub fn invalid_cursor(cursor: &str) -> Self

Source

pub fn invalid_apply_payload( message: impl Into<String>, path: Option<&str>, ) -> Self

Source

pub fn with_code(self, code: impl Into<String>) -> Self

Source

pub fn with_details(self, details: Value) -> Self

Source

pub fn exit_code(&self) -> i32

Source

pub fn code(&self) -> &str

Source

pub fn message(&self) -> &str

Source

pub fn json_error(&self) -> JsonError<'_>

Trait Implementations§

Source§

impl Debug for AppError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Error> for AppError

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.