[][src]Enum oxide_auth::frontends::actix::ResourceProtection

pub enum ResourceProtection<W: WebResponse> {
    Respond(W),
    Error(W::Error),
}

A wrapper around a result allowing more specific interpretation.

Simplifies trait semantics while also providing additional documentation on the semantics of each variant. Conversion to a standard Result is of course easily possible.

Variants

Respond(W)

The error response to the failed access should be based on this.

Ensures that the WWW-Authenticate header is set on the response and also has the status code already set. While you should use this as a nice helper, it isn't exactly mandatory to actually send a response based on this. Just don't allow access to the underlying resource.

Error(W::Error)

Something went wrong while checking access.

This is an internal server error (or a library issue) but it's not always wise to directly indicate this to clients. The OAuthError variants help with this and OAuthFailure also provides some sensible choices.

Methods

impl<W: WebResponse> ResourceProtection<W>[src]

pub fn into_result(self) -> Result<W, W::Error>[src]

Turn self into a standard error.

Auto Trait Implementations

impl<W> Unpin for ResourceProtection<W> where
    W: Unpin,
    <W as WebResponse>::Error: Unpin

impl<W> Send for ResourceProtection<W> where
    W: Send,
    <W as WebResponse>::Error: Send

impl<W> Sync for ResourceProtection<W> where
    W: Sync,
    <W as WebResponse>::Error: Sync

impl<W> RefUnwindSafe for ResourceProtection<W> where
    W: RefUnwindSafe,
    <W as WebResponse>::Error: RefUnwindSafe

impl<W> UnwindSafe for ResourceProtection<W> where
    W: UnwindSafe,
    <W as WebResponse>::Error: UnwindSafe

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> UnsafeAny for T where
    T: Any

impl<T> IntoCollection<T> for T

impl<T, I> AsResult<T, I> for T where
    I: Input,