#[non_exhaustive]pub enum TextParseError {
MissingHeader {
observed: String,
},
MissingWireBytesLine {
observed: String,
},
WireBytesTooLarge {
declared: usize,
},
InvalidHexCharacter {
line: usize,
character: char,
},
OddHexLineLength {
line: usize,
observed: usize,
},
DeclaredLengthMismatch {
declared: usize,
actual: usize,
},
WireDecodeFailed {
inner: Error,
},
WireEncodeFailed {
inner: Error,
},
}Expand description
Error returned when a text-format program fails to parse.
Every variant carries an actionable Fix: message rendered via
TextParseError::fix_hint. Parsing never panics.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingHeader
The program did not start with the vyre_ir v0.1 header.
MissingWireBytesLine
The header was present but the second line was not the
expected wire_bytes N declaration.
WireBytesTooLarge
wire_bytes parsed but exceeded MAX_TEXT_WIRE_BYTES.
InvalidHexCharacter
A hex line contained a non-hex character.
Fields
OddHexLineLength
A hex line’s character count was odd, which cannot round-trip to whole bytes.
DeclaredLengthMismatch
Total decoded bytes did not match the declared wire_bytes.
WireDecodeFailed
The inner binary wire decoder rejected the byte payload.
The carried error is whatever Program::from_wire emitted —
a typed crate::error::Error whose Display impl already
carries the Fix:-prefixed diagnostic prose.
WireEncodeFailed
The inner binary wire encoder rejected the program when
we tried to serialize it. Only emitted by to_text.
Implementations§
Trait Implementations§
Source§impl Clone for TextParseError
impl Clone for TextParseError
Source§fn clone(&self) -> TextParseError
fn clone(&self) -> TextParseError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextParseError
impl Debug for TextParseError
Source§impl Display for TextParseError
impl Display for TextParseError
Source§impl Error for TextParseError
impl Error for TextParseError
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()
Source§impl PartialEq for TextParseError
impl PartialEq for TextParseError
impl Eq for TextParseError
impl StructuralPartialEq for TextParseError
Auto Trait Implementations§
impl Freeze for TextParseError
impl RefUnwindSafe for TextParseError
impl Send for TextParseError
impl Sync for TextParseError
impl Unpin for TextParseError
impl UnsafeUnpin for TextParseError
impl UnwindSafe for TextParseError
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
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
key and return true if they are equal.