[][src]Enum srvrls::components::SrvrlsError

pub enum SrvrlsError {
    BadRequest(String),
    BadRequestNoMessage(),
    BadRequestWithSimpleMessage(String),
    Unauthorized,
    Forbidden,
    NotFound,
    MethodNotAllowed,
    InternalServerError,
}

You can always return the precise error response, but using the specific error allows a much cleaner rolloff using the ? operator. All of these translate directly to their respective 4xx or 5xx HTTP responses.

Variants

BadRequest(String)

Responds with a 400 - Bad Request response using the provided payload

BadRequestNoMessage()

Responds with a 400 - Bad Request response with no payload

BadRequestWithSimpleMessage(String)

Responds with a 400 - Bad Request response using the provided message in a SimpleMessage

Unauthorized

Responds with a 401 - Unauthorized response

Forbidden

Responds with a 403 - Forbidden response

NotFound

Responds with a 404 - Not Found response

MethodNotAllowed

Responds with a 405 - Method Not Allowed response

InternalServerError

Responds with a 500 - Internal Server Error response

Trait Implementations

impl Clone for SrvrlsError[src]

impl Debug for SrvrlsError[src]

impl Display for SrvrlsError[src]

impl Error for SrvrlsError[src]

impl PartialEq<SrvrlsError> for SrvrlsError[src]

impl StructuralPartialEq for SrvrlsError[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsFail for T where
    T: Fail, 

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

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

impl<E> Fail for E where
    E: 'static + Error + Send + Sync

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,