#[non_exhaustive]pub enum Invalid {
PasswordTooShort {
min: usize,
},
PasswordIncorrect,
EmailRequired,
LoginOrEmailRequired,
LoginEmpty,
LoginsDisabled,
EmailManagedByGoogle,
GoogleAccountTaken,
RoleNotChangeable,
MalformedRequest,
Unknown,
}alloc only.Expand description
Why a request is invalid, the detail of AuthError::Invalid.
On the wire a reason is a stable code with its parameters, such as
{"reason":"password_too_short","min":8}, so a frontend can phrase it in
its own language. Display gives an English message for
the user.
New reasons may be added without a breaking release. One this version
does not know, sent by a newer server, decodes as Invalid::Unknown,
so an older frontend still shows that the request was refused.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PasswordTooShort
The password is shorter than min bytes; see validate_password.
Fields
min: usizeThe shortest password accepted, MIN_PASSWORD_LEN.
PasswordIncorrect
The current password, given to change it, is wrong.
EmailRequired
The app uses only emails, and the user would have none.
LoginOrEmailRequired
The user would have neither a login nor an email.
LoginEmpty
The login name is blank.
LoginsDisabled
A login name was given, but the app uses only emails.
EmailManagedByGoogle
A Google user tried to change their own email, which their Google account manages.
GoogleAccountTaken
The Google account is already linked to another user.
RoleNotChangeable
The role cannot be changed through this route, such as on the user’s own account.
MalformedRequest
The request body could not be read, such as malformed JSON or a missing field.
Unknown
A reason this version does not know, from a newer server; its parameters are dropped. A server never sends it.
New reasons go after it, at the end, since musli numbers variants by position.
Trait Implementations§
Source§impl<'__de, __A> Decode<'__de, Binary, __A> for Invalidwhere
__A: Allocator,
Available on crate feature musli02 only.
impl<'__de, __A> Decode<'__de, Binary, __A> for Invalidwhere
__A: Allocator,
musli02 only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Source§impl<'__de, __A> Decode<'__de, Text, __A> for Invalidwhere
__A: Allocator,
Available on crate feature musli02 only.
impl<'__de, __A> Decode<'__de, Text, __A> for Invalidwhere
__A: Allocator,
musli02 only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Source§impl<'de> Deserialize<'de> for Invalid
impl<'de> Deserialize<'de> for Invalid
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>,
Source§impl Encode<Binary> for Invalid
Available on crate feature musli02 only.
impl Encode<Binary> for Invalid
musli02 only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Source§impl Encode<Text> for Invalid
Available on crate feature musli02 only.
impl Encode<Text> for Invalid
musli02 only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
impl Eq for Invalid
Source§impl Error for Invalid
impl Error for Invalid
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()