pub enum Error {
Show 18 variants
RoleAlreadyExists(String),
RoleNotFound(String),
SubjectNotFound(String),
PermissionDenied(Box<PermissionDeniedDetails>),
CircularDependency(String),
InvalidPermission(String),
InvalidResource(String),
ElevationExpired(String),
MaxDepthExceeded(usize),
Storage(String),
InvalidConfiguration(String),
RoleOperationFailed {
operation: String,
role: String,
reason: String,
},
PermissionOperationFailed {
operation: String,
subject: String,
resource: String,
reason: String,
context: Box<HashMap<String, String>>,
},
ValidationError {
field: String,
reason: String,
invalid_value: Option<String>,
},
RateLimitExceeded {
subject: String,
limit: u64,
window: String,
},
ConcurrencyConflict {
operation: String,
resource_id: String,
},
AuthenticationFailed {
reason: String,
subject_id: Option<String>,
},
AuthorizationFailed {
subject: String,
permission: String,
resource: String,
required_roles: Vec<String>,
},
}Expand description
The main error type for role system operations.
Variants§
RoleAlreadyExists(String)
Role with the given name already exists.
RoleNotFound(String)
Role with the given name was not found.
SubjectNotFound(String)
Subject with the given ID was not found.
PermissionDenied(Box<PermissionDeniedDetails>)
Permission was denied for the requested operation.
CircularDependency(String)
Circular dependency detected in role hierarchy.
InvalidPermission(String)
Invalid permission format.
InvalidResource(String)
Invalid resource format.
ElevationExpired(String)
Role elevation has expired.
MaxDepthExceeded(usize)
Maximum role hierarchy depth exceeded.
Storage(String)
Storage operation failed.
InvalidConfiguration(String)
Invalid configuration.
RoleOperationFailed
Enhanced role operation error with context.
PermissionOperationFailed
Permission operation error with detailed context.
Fields
ValidationError
Validation error with field-specific information.
RateLimitExceeded
Rate limiting error.
ConcurrencyConflict
Concurrency conflict error.
AuthenticationFailed
Authentication error.
AuthorizationFailed
Authorization error with detailed context.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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