pub enum SecurityError {
Show 35 variants
Configuration(String),
Authentication(String),
Authorization(String),
Jwt(Error),
OAuth2(String),
Mfa(String),
Password(String),
Session(String),
Http(Error),
Json(Error),
Url(ParseError),
Io(Error),
Utf8(FromUtf8Error),
Time(String),
Crypto(String),
InvalidInput(String),
TokenExpired,
TokenInvalid,
UserNotFound,
UserExists,
RateLimitExceeded,
MfaRequired,
MfaSetupRequired,
AccountLocked,
AccountDisabled,
InvalidCredentials,
InsufficientPermissions,
ProviderNotSupported,
StateMismatch,
CsrfTokenInvalid,
SessionExpired,
SessionInvalid,
Database(String),
Cache(String),
ExternalService(String),
}Expand description
Security error types
Variants§
Configuration(String)
Authentication(String)
Authorization(String)
Jwt(Error)
OAuth2(String)
Mfa(String)
Password(String)
Session(String)
Http(Error)
Json(Error)
Url(ParseError)
Io(Error)
Utf8(FromUtf8Error)
Time(String)
Crypto(String)
InvalidInput(String)
TokenExpired
TokenInvalid
UserNotFound
UserExists
RateLimitExceeded
MfaRequired
MfaSetupRequired
AccountLocked
AccountDisabled
InvalidCredentials
InsufficientPermissions
ProviderNotSupported
StateMismatch
CsrfTokenInvalid
SessionExpired
SessionInvalid
Database(String)
Cache(String)
ExternalService(String)
Implementations§
Source§impl SecurityError
impl SecurityError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if error is client error (4xx)
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if error is server error (5xx)
Sourcepub fn http_status_code(&self) -> u16
pub fn http_status_code(&self) -> u16
Get HTTP status code for error
Sourcepub fn user_message(&self) -> &'static str
pub fn user_message(&self) -> &'static str
Get user-friendly error message
Trait Implementations§
Source§impl Debug for SecurityError
impl Debug for SecurityError
Source§impl Display for SecurityError
impl Display for SecurityError
Source§impl Error for SecurityError
impl Error for SecurityError
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 From<Error> for SecurityError
Convert from anyhow::Error for compatibility
impl From<Error> for SecurityError
Convert from anyhow::Error for compatibility
Source§impl From<ParseError> for SecurityError
Convert from chrono errors
impl From<ParseError> for SecurityError
Convert from chrono errors
Source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<SecretParseError> for SecurityError
Convert from TOTP secret parse errors
impl From<SecretParseError> for SecurityError
Convert from TOTP secret parse errors
Source§fn from(err: SecretParseError) -> Self
fn from(err: SecretParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SecurityError
impl !RefUnwindSafe for SecurityError
impl Send for SecurityError
impl Sync for SecurityError
impl Unpin for SecurityError
impl !UnwindSafe for SecurityError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more