#[non_exhaustive]pub enum SubCode {
InvalidArchive(InvalidArchiveSubCode),
SecurityViolation(SecurityViolationSubCode),
Quota(QuotaKind),
ZipBomb(ZipBombScope),
}Expand description
The finer classification of an error, tagged with the class it refines.
The variant is the error class, so a pair of class and sub-code that core never produces cannot be built.
§Examples
use exarch_core::InvalidArchiveSubCode;
use exarch_core::SubCode;
let code = SubCode::InvalidArchive(InvalidArchiveSubCode::TarTrailer);
assert_eq!(code.as_str(), "TAR_TRAILER");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidArchive(InvalidArchiveSubCode)
Refines ErrorCode::InvalidArchive.
SecurityViolation(SecurityViolationSubCode)
Refines ErrorCode::SecurityViolation.
Quota(QuotaKind)
Refines ErrorCode::QuotaExceeded with the quota that was exceeded.
ZipBomb(ZipBombScope)
Refines ErrorCode::ZipBomb with what the ratio was measured over.
Implementations§
Source§impl SubCode
impl SubCode
Sourcepub const QUOTA_ALL: &'static [Self]
pub const QUOTA_ALL: &'static [Self]
Every sub-code of a quota error, in QuotaKind::ALL order.
Sourcepub const ZIP_BOMB_ALL: &'static [Self]
pub const ZIP_BOMB_ALL: &'static [Self]
Every sub-code of a zip-bomb error, in ZipBombScope::ALL order.
Trait Implementations§
impl Copy for SubCode
impl Eq for SubCode
impl StructuralPartialEq for SubCode
Auto Trait Implementations§
impl Freeze for SubCode
impl RefUnwindSafe for SubCode
impl Send for SubCode
impl Sync for SubCode
impl Unpin for SubCode
impl UnsafeUnpin for SubCode
impl UnwindSafe for SubCode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.