pub enum RTokenError {
MutexPoisoned,
}Expand description
Errors that can occur during token management operations.
This error type implements std::error::Error and actix_web::ResponseError,
allowing it to be used seamlessly in actix-web handlers.
§Examples
use r_token::{RTokenManager, RTokenError};
let manager = RTokenManager::new();
let result = manager.login("user123");
match result {
Ok(token) => println!("Token generated: {}", token),
Err(RTokenError::MutexPoisoned) => eprintln!("Failed to acquire lock"),
}Variants§
MutexPoisoned
The internal mutex protecting the token store has been poisoned.
This typically occurs when a thread panics while holding the lock. In most cases, this indicates a critical error in the application.
Trait Implementations§
Source§impl Debug for RTokenError
impl Debug for RTokenError
Source§impl Display for RTokenError
impl Display for RTokenError
Source§impl Error for RTokenError
impl Error for RTokenError
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 ResponseError for RTokenError
impl ResponseError for RTokenError
Source§fn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Returns appropriate status code for error. Read more
Source§fn error_response(&self) -> HttpResponse
fn error_response(&self) -> HttpResponse
Creates full response for error. Read more
Auto Trait Implementations§
impl Freeze for RTokenError
impl RefUnwindSafe for RTokenError
impl Send for RTokenError
impl Sync for RTokenError
impl Unpin for RTokenError
impl UnwindSafe for RTokenError
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