#[non_exhaustive]pub enum Class {
Cancelled,
Corruption,
ResourceExhaustion(ResourceExhaustionKind),
Validation,
Unsupported,
Unauthenticated,
PermissionDenied,
Conflict,
NotFound,
Retryable,
}Expand description
The recovery approach suggested by an error.
Variants are listed in suggested recovery precedence, highest first; smaller values have higher precedence
under Ord. crate::Error::dominant_class() selects the smallest class present in the error tree.
When multiple classes are present, check earlier variants before later ones: cancellation means stop,
while retryability alone does not override a failure that needs another remedy. Adapt this precedence
to the operation and its concrete errors.
Classification iterators retain error traversal order, not this precedence, and class predicates report
presence independently rather than suppressing lower-priority classes.
A class guides recovery, but does not establish that it is safe. Inspect concrete errors and partial outcomes before repeating operations with side effects; see recovery.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cancelled
The caller requested cancellation; stop rather than retry.
Corruption
Stored or streamed data was malformed or internally inconsistent.
Recovery may require repairing, replacing, or re-fetching the data, rather than correcting the caller’s input.
ResourceExhaustion(ResourceExhaustionKind)
A finite resource was exhausted.
Recovery may require reducing resource use or making more capacity available before retrying. The kind distinguishes an application-configured allocation limit from an allocation failure, so callers can choose whether to adjust a limit or address the allocation itself.
Validation
Function or method input was invalid.
Recovery requires correcting the input rather than retrying the same request unchanged.
Unsupported
A required capability is unsupported; switch implementation, format, protocol, or strategy.
Unauthenticated
Credentials are missing or rejected; obtain or refresh credentials.
PermissionDenied
Authorization or permissions are insufficient; obtain authorization or change permissions.
Conflict
Current state conflicts with the operation; refresh or reconcile state before retrying.
NotFound
A requested resource does not exist.
Callers may recover by creating the resource, using a fallback, or treating absence as an expected outcome. This distinguishes absence from failures that prevent determining whether the resource exists.
Retryable
Retrying the operation may succeed.
Callers may recover with a bounded retry, possibly after waiting, without changing the request. This is not a guarantee of success or a statement that repeating an operation with side effects is safe.