#[non_exhaustive]pub enum DfaWireError {
Truncated {
needed: usize,
got: usize,
},
BadMagic,
VersionMismatch {
expected: u32,
found: u32,
},
ShapeMismatch {
reason: &'static str,
},
SectionTooLarge {
len: usize,
max: usize,
},
Envelope(String),
}Expand description
Returned from CompiledDfa::from_bytes when the on-wire payload
cannot be decoded into a valid DFA. The variant carries enough
context for the caller to discriminate “stale cache, recompile” from
“actual bug, refuse”.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
Payload is shorter than the fixed header / a declared section.
Fields
BadMagic
First four bytes were not the VDFA magic - caller likely passed
an unrelated blob.
VersionMismatch
Wire version did not match the build’s DFA_WIRE_VERSION. The
caller’s cache is from an older scanner consumer/vyre and must be rebuilt.
Fields
ShapeMismatch
One of the array length fields disagreed with the declared
state_count - corrupt or hand-crafted blob.
SectionTooLarge
A payload section exceeded the wire envelope’s u32 length prefix.
Fields
Envelope(String)
The shared wire envelope returned an error variant this crate reports through the generic envelope branch.
Trait Implementations§
Source§impl Clone for DfaWireError
impl Clone for DfaWireError
Source§fn clone(&self) -> DfaWireError
fn clone(&self) -> DfaWireError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DfaWireError
impl Debug for DfaWireError
Source§impl Display for DfaWireError
impl Display for DfaWireError
Source§impl Error for DfaWireError
impl Error for DfaWireError
1.30.0 · 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()