#[non_exhaustive]pub enum ErrorKind {
Show 20 variants
Missing,
TooLong {
max: usize,
actual: usize,
},
WrongLength {
expected: usize,
actual: usize,
},
InvalidCharacter {
format: &'static str,
found: char,
},
NotLatin1 {
found: char,
},
LeadingZero {
format: &'static str,
},
NumberTooLarge,
InvalidDate,
InvalidTime,
InvalidYesNo,
InvalidValue,
ExpectedText,
ExpectedBinary,
TooFewRepetitions {
min: usize,
actual: usize,
},
TooManyRepetitions {
max: usize,
actual: usize,
},
UnexpectedData,
InvalidHeader(String),
WrongSegment {
expected_code: &'static str,
expected_version: u16,
},
UnknownSegment,
Wire(WireError),
}tooling only.Expand description
A rule broken by a value, found while parsing or serialising.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Missing
A mandatory element is empty or absent (Formals B.3.1, status M).
TooLong
Longer than the maximum length (B.3.3, ..n), counted before escaping.
WrongLength
Not the fixed length (B.3.3).
InvalidCharacter
A character the format does not allow (B.4).
NotLatin1
A character outside ISO 8859-1 (B.1); cannot be put on the wire.
LeadingZero
num/float with a leading zero (B.4.1).
NumberTooLarge
A number that does not fit the Rust type behind the element.
InvalidDate
Not a valid dat (B.4.2: JJJJMMTT, an existing date).
InvalidTime
Not a valid tim (B.4.2: hhmmss, a valid time).
InvalidYesNo
Not J or N (B.4.2, jn).
InvalidValue
Not a valid float/wrt value (B.4.1: decimal comma obligatory).
ExpectedText
Binary data where the format is text.
ExpectedBinary
Text where the format is bin (H.1.4).
TooFewRepetitions
Fewer repetitions than the minimum count (B.3.1).
TooManyRepetitions
More repetitions than the maximum count (B.3.1).
UnexpectedData
Non-empty elements after the last element the definition knows.
InvalidHeader(String)
The segment header (code:number:version[:reference]) is malformed.
WrongSegment
The segment is a different code or version than the definition.
UnknownSegment
No definition for this code and version is registered.
Wire(WireError)
The message could not be tokenized.
Trait Implementations§
impl Eq for ErrorKind
Source§impl Error for ErrorKind
impl Error for ErrorKind
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()