Struct actix_web_httpauth::extractors::AuthenticationError
source · [−]pub struct AuthenticationError<C: Challenge> { /* private fields */ }
Expand description
Authentication error returned by authentication extractors.
Different extractors may extend AuthenticationError
implementation in order to provide access
inner challenge fields.
Implementations
sourceimpl AuthenticationError<Bearer>
impl AuthenticationError<Bearer>
Extended error customization for HTTP Bearer
auth.
sourcepub fn with_error(self, kind: Error) -> Self
pub fn with_error(self, kind: Error) -> Self
Attach Error
to the current Authentication error.
Error status code will be changed to the one provided by the kind
Error.
sourcepub fn with_error_description<T>(self, desc: T) -> Self where
T: Into<Cow<'static, str>>,
pub fn with_error_description<T>(self, desc: T) -> Self where
T: Into<Cow<'static, str>>,
Attach error description to the current Authentication error.
sourcepub fn with_error_uri<T>(self, uri: T) -> Self where
T: Into<Cow<'static, str>>,
pub fn with_error_uri<T>(self, uri: T) -> Self where
T: Into<Cow<'static, str>>,
Attach error URI to the current Authentication error.
It is up to implementor to provide properly formed absolute URI.
sourceimpl<C: Challenge> AuthenticationError<C>
impl<C: Challenge> AuthenticationError<C>
sourcepub fn new(challenge: C) -> AuthenticationError<C>
pub fn new(challenge: C) -> AuthenticationError<C>
Creates new authentication error from the provided challenge
.
By default returned error will resolve into the HTTP 401
status code.
sourcepub fn challenge_mut(&mut self) -> &mut C
pub fn challenge_mut(&mut self) -> &mut C
Returns mutable reference to the inner challenge instance.
sourcepub fn status_code_mut(&mut self) -> &mut StatusCode
pub fn status_code_mut(&mut self) -> &mut StatusCode
Returns mutable reference to the inner status code.
Can be used to override returned status code, but by default this lib tries to stick to the RFC, so it might be unreasonable.
Trait Implementations
sourceimpl<C: Debug + Challenge> Debug for AuthenticationError<C>
impl<C: Debug + Challenge> Debug for AuthenticationError<C>
sourceimpl<C: Challenge> Display for AuthenticationError<C>
impl<C: Challenge> Display for AuthenticationError<C>
sourceimpl<C: Challenge + 'static> Error for AuthenticationError<C>
impl<C: Challenge + 'static> Error for AuthenticationError<C>
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl<T> From<T> for AuthenticationError<<T as AuthExtractorConfig>::Inner> where
T: AuthExtractorConfig,
impl<T> From<T> for AuthenticationError<<T as AuthExtractorConfig>::Inner> where
T: AuthExtractorConfig,
sourceimpl<C: Challenge + 'static> ResponseError for AuthenticationError<C>
impl<C: Challenge + 'static> ResponseError for AuthenticationError<C>
sourcefn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Returns appropriate status code for error. Read more
sourcefn error_response(&self) -> HttpResponse
fn error_response(&self) -> HttpResponse
Creates full response for error. Read more
Auto Trait Implementations
impl<C> RefUnwindSafe for AuthenticationError<C> where
C: RefUnwindSafe,
impl<C> Send for AuthenticationError<C>
impl<C> Sync for AuthenticationError<C>
impl<C> Unpin for AuthenticationError<C> where
C: Unpin,
impl<C> UnwindSafe for AuthenticationError<C> where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more