[][src]Struct tide::Error

pub struct Error { /* fields omitted */ }

The error type for HTTP operations.

Methods

impl Error[src]

pub fn new<E>(status: StatusCode, error: E) -> Error where
    E: Error + Send + Sync + 'static, 
[src]

Create a new error object from any error type.

The error type must be threadsafe and 'static, so that the Error will be as well. If the error type does not provide a backtrace, a backtrace will be created here to ensure that a backtrace exists.

pub fn from_str<M>(status: StatusCode, msg: M) -> Error where
    M: Display + Debug + Send + Sync + 'static, 
[src]

Create a new error object from static string.

pub fn status(&self) -> StatusCode[src]

Get the status code associated with this error.

pub fn set_status(&mut self, status: StatusCode)[src]

Set the status code associated with this error.

pub fn downcast<E>(self) -> Result<E, Error> where
    E: Display + Debug + Send + Sync + 'static, 
[src]

Attempt to downcast the error object to a concrete type.

pub fn downcast_ref<E>(&self) -> Option<&E> where
    E: Display + Debug + Send + Sync + 'static, 
[src]

Downcast this error object by reference.

pub fn downcast_mut<E>(&mut self) -> Option<&mut E> where
    E: Display + Debug + Send + Sync + 'static, 
[src]

Downcast this error object by mutable reference.

Trait Implementations

impl AsMut<StatusCode> for Error[src]

impl AsRef<StatusCode> for Error[src]

impl AsRef<dyn Error + 'static + Send + Sync> for Error[src]

impl AsRef<dyn Error + 'static> for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl<E> From<E> for Error where
    E: Error + Send + Sync + 'static, 
[src]

impl From<Response> for Error[src]

impl IntoResponse for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

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<!> for T[src]

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

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

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.