Struct got_ya_id::errors::error::ResError[][src]

pub struct ResError {
    pub msg: String,
    pub status: u16,
}

Custom Error to send in http responses

Fields

msg: String

Error message

status: u16

Status code

Implementations

impl ResError[src]

pub fn new(msg: String, status: u16) -> Self[src]

Create a new instance of the ResError

pub fn unauthorized() -> Self[src]

Returns an Unauthorized error response Status: 401

pub fn not_found() -> Self[src]

Returns a NOT FOUND error response Status: 404

Trait Implementations

impl Debug for ResError[src]

impl Display for ResError[src]

impl From<Error> for ResError[src]

impl From<Error> for ResError[src]

impl From<Error> for ResError[src]

impl From<Error> for ResError[src]

impl From<ParseError> for ResError[src]

impl ResponseError for ResError[src]

fn error_response(&self) -> HttpResponse[src]

Builds the sendable response

impl Serialize for ResError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromPy<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoPy<U> for T where
    U: FromPy<T>, 
[src]

impl<T> IntoSql for T[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,