Error

Enum Error 

Source
pub enum Error<W: WebRequest> {
    Web(W::Error),
    OAuth(OAuthError),
}
Expand description

Errors either caused by the underlying web types or the library.

Variants§

§

Web(W::Error)

An operation on a request or response failed.

Typically, this should be represented as a 500–Internal Server Error.

§

OAuth(OAuthError)

Some part of the library signaled failure.

No response has been generated, and in some cases doing so should be done with care or under the consideration of an attacker currently trying to abuse the system.

Implementations§

Source§

impl<W: WebRequest> Error<W>

Source

pub fn pack<P>(self) -> P
where OAuthError: Into<P>, W::Error: Into<P>,

Convert into a single error type.

Note that the additional information whether the error occurred in the web components or during the flow needs to be implicitely contained in the types. Otherwise, this information is lost and you should use or provide a From<Error<W>> implementation instead. This method is still useful for frontends providing a standard error type that interacts with their web server library.

Trait Implementations§

Source§

impl<W: Debug + WebRequest> Debug for Error<W>
where W::Error: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<W> Freeze for Error<W>
where <W as WebRequest>::Error: Freeze,

§

impl<W> RefUnwindSafe for Error<W>

§

impl<W> Send for Error<W>
where <W as WebRequest>::Error: Send,

§

impl<W> Sync for Error<W>
where <W as WebRequest>::Error: Sync,

§

impl<W> Unpin for Error<W>
where <W as WebRequest>::Error: Unpin,

§

impl<W> UnwindSafe for Error<W>
where <W as WebRequest>::Error: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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

Source§

fn vzip(self) -> V