pub enum AuthError {
Unauthorized,
Forbidden,
NotFound,
Gone,
TooManyRequests,
Conflict(Conflict),
Invalid(Invalid),
}Available on crate feature
alloc only.Expand description
The error of an /api/auth route, sent as the JSON body of its 4xx
response, such as {"error":"conflict","detail":"email"} or
{"error":"invalid","detail":{"reason":"password_too_short","min":8}}.
Variants§
Not signed in, or the credentials are wrong (401).
Forbidden
Signed in, but not allowed (403).
NotFound
No such user or link (404).
Gone
The link was used or has expired (410).
TooManyRequests
Too many sign-in attempts (429).
Conflict(Conflict)
The login or email is taken (409).
Invalid(Invalid)
The request is invalid, and why (400).
Implementations§
Trait Implementations§
Source§impl<'__de, __A> Decode<'__de, Binary, __A> for AuthErrorwhere
__A: Allocator,
Available on crate feature musli02 only.
impl<'__de, __A> Decode<'__de, Binary, __A> for AuthErrorwhere
__A: Allocator,
Available on crate feature
musli02 only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<'__de, __A> Decode<'__de, Text, __A> for AuthErrorwhere
__A: Allocator,
Available on crate feature musli02 only.
impl<'__de, __A> Decode<'__de, Text, __A> for AuthErrorwhere
__A: Allocator,
Available on crate feature
musli02 only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<'de> Deserialize<'de> for AuthError
impl<'de> Deserialize<'de> for AuthError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encode<Binary> for AuthError
Available on crate feature musli02 only.
impl Encode<Binary> for AuthError
Available on crate feature
musli02 only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl Encode<Text> for AuthError
Available on crate feature musli02 only.
impl Encode<Text> for AuthError
Available on crate feature
musli02 only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
impl Eq for AuthError
Source§impl Error for AuthError
impl Error for AuthError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl IntoResponse for AuthError
Available on crate feature axum08 only.Answers with the error as its JSON body, such as
{"error":"conflict","detail":"email"}, and its
status.
impl IntoResponse for AuthError
Available on crate feature
axum08 only.Answers with the error as its JSON body, such as
{"error":"conflict","detail":"email"}, and its
status.
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
impl StructuralPartialEq for AuthError
Auto Trait Implementations§
impl Freeze for AuthError
impl RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnsafeUnpin for AuthError
impl UnwindSafe for AuthError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<'de, T> DecodeBody<'de> for T
impl<M, D, A> DecodeOwned<M, A> for D
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> EncodeBody for T
Source§impl<T, S> Handler<IntoResponseHandler, S> for T
impl<T, S> Handler<IntoResponseHandler, S> for T
Source§fn call(
self,
_req: Request<Body>,
_state: S,
) -> <T as Handler<IntoResponseHandler, S>>::Future
fn call( self, _req: Request<Body>, _state: S, ) -> <T as Handler<IntoResponseHandler, S>>::Future
Call the handler with the given request.
Source§fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
Apply a
tower::Layer to the handler. Read moreSource§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Convert the handler into a
Service by providing the stateSource§impl<H, T> HandlerWithoutStateExt<T> for H
impl<H, T> HandlerWithoutStateExt<T> for H
Source§fn into_service(self) -> HandlerService<H, T, ()>
fn into_service(self) -> HandlerService<H, T, ()>
Convert the handler into a
Service and no state.Source§fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
Convert the handler into a
MakeService and no state. Read more