#[non_exhaustive]pub enum SegmentError {
Io(Error),
Cbor {
phase: &'static str,
path: PathBuf,
message: String,
},
Cipher {
path: PathBuf,
message: String,
},
Integrity {
path: PathBuf,
reason: &'static str,
},
}Expand description
Errors produced by segment-buffer operations.
Every non-I/O variant carries the path of the segment file
involved, so an operator can act on the failure without spelunking through
logs.
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.
Io(Error)
Filesystem I/O failure (directory creation, segment read/write, rename, etc.).
Kept as a tuple variant with #[from] so ? remains ergonomic at the
many I/O call sites where per-site context would add noise without value.
Cbor
CBOR serialization or deserialization of a segment file failed.
Fields
Cipher
Cipher encrypt or decrypt of a segment file failed (key mismatch, AEAD tag invalid, cipher misconfiguration).
Fields
Integrity
Segment file failed an integrity check: truncated, too small for the AEAD nonce, or unrecognized envelope.
Trait Implementations§
Source§impl Debug for SegmentError
impl Debug for SegmentError
Source§impl Display for SegmentError
impl Display for SegmentError
Source§impl Error for SegmentError
impl Error for SegmentError
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 !RefUnwindSafe for SegmentError
impl !UnwindSafe for SegmentError
impl Freeze for SegmentError
impl Send for SegmentError
impl Sync for SegmentError
impl Unpin for SegmentError
impl UnsafeUnpin for SegmentError
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