#[non_exhaustive]pub enum StryptError {
Io {
action: IoAction,
source: Error,
},
OutputExists,
InputTooLarge {
limit: u64,
actual: Option<u64>,
},
UnsupportedFormat {
format: UnsupportedKind,
},
UnrecognisedFormat,
Malformed {
format: Format,
offset: Option<u64>,
detail: MalformedDetail,
},
LimitExceeded {
format: Format,
limit: ResourceLimit,
},
VerificationFailed {
format: Format,
residual: usize,
},
}Expand description
Everything that can go wrong in strypt-core.
Non-exhaustive: new variants are additive and must not break front-ends that match on it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
The underlying I/O operation failed.
action says what was being attempted, so a front-end can render “could not read the
input” rather than a bare ENOENT.
Fields
OutputExists
The destination exists and the caller did not ask to replace it. A refusal, not an I/O failure: the fix is the caller’s, so it must not read as a disk problem.
InputTooLarge
The input exceeds the configured size limit and was not read.
This is a refusal, not a failure: an unbounded read of an attacker-supplied file is a
memory-exhaustion vector (docs/ARCHITECTURE.md §5.1), so strypt declines rather than
trying and dying.
Fields
UnsupportedFormat
The content was recognised, but no handler for it exists in this release.
Reported explicitly and never silently passed through — a silent pass-through is the
failure mode in docs/THREAT_MODEL.md §5.4, where the user publishes a file the tool
implied it had cleaned.
Fields
format: UnsupportedKindWhat the content was identified as.
UnrecognisedFormat
The content matched no format strypt recognises at all.
Malformed
The file claims to be format but violates its structure.
Fields
detail: MalformedDetailWhich structural rule was violated. Never contains a metadata value.
LimitExceeded
A hostile or pathological file hit one of the parser’s resource ceilings.
For memory-safe Rust this is the realistic residual attack class, not memory
corruption (docs/THREAT_MODEL.md §5.1), so it gets its own variant rather than being
folded into StryptError::Malformed.
Fields
limit: ResourceLimitWhich ceiling.
VerificationFailed
The handler produced output, but re-inspecting that output still found metadata.
The output is discarded. This is the verification pass in docs/ARCHITECTURE.md §1
doing its job: it converts a silent handler bug into a loud, safe failure, which is
the whole reason it exists.
Trait Implementations§
Source§impl Debug for StryptError
impl Debug for StryptError
Source§impl Display for StryptError
impl Display for StryptError
Source§impl Error for StryptError
impl Error for StryptError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()