pub enum OptBlockError {
Show 16 variants
StringTooShort {
minimum: usize,
actual: usize,
},
NonAsciiInput,
ExtendedLengthStringTooShort {
minimum: usize,
actual: usize,
},
StringTooShortForLength {
required: usize,
actual: usize,
},
Uninitialized {
length: usize,
},
InvalidId(String),
IdNotSet,
NonAsciiData(String),
BlockTooLong {
maximum: usize,
actual: usize,
},
InvalidLengthFieldWidth {
value: String,
expected: usize,
},
InvalidLengthFieldHex {
value: String,
source: ParseIntError,
},
LengthFieldTooSmall {
minimum: usize,
actual: usize,
},
InvalidExtendedLengthField(String),
InvalidLengthOfLengthField(String),
InvalidExtendedLengthHex {
value: String,
source: ParseIntError,
},
ExtendedLengthTooSmall {
value: String,
},
}Expand description
Errors produced while constructing, parsing, or serializing TR-31 optional blocks.
Variants§
StringTooShort
The supplied optional-block string does not contain the minimum ID and length fields.
NonAsciiInput
Optional blocks are defined using ASCII data and cannot safely be parsed from arbitrary UTF-8 strings.
ExtendedLengthStringTooShort
An extended-length optional block must contain at least 256 bytes.
StringTooShortForLength
The encoded optional-block length exceeds the available input.
Uninitialized
An optional block has not been initialized sufficiently for export.
InvalidId(String)
The optional-block identifier is not supported.
IdNotSet
Data was assigned before an optional-block identifier.
NonAsciiData(String)
Optional-block data contains non-ASCII characters.
BlockTooLong
The complete optional block exceeds the maximum representable size.
InvalidLengthFieldWidth
A normal length field must consist of exactly two hexadecimal characters.
InvalidLengthFieldHex
A normal length field is not valid hexadecimal.
LengthFieldTooSmall
A normal optional-block length cannot be smaller than four bytes.
InvalidExtendedLengthField(String)
An extended length field must consist of exactly six characters.
InvalidLengthOfLengthField(String)
The first two characters of the extended length field must encode the supported length-of-length value.
InvalidExtendedLengthHex
The extended block length is not valid hexadecimal.
ExtendedLengthTooSmall
Extended encoding may only be used for block lengths greater than 255 bytes.
Trait Implementations§
Source§impl Debug for OptBlockError
impl Debug for OptBlockError
Source§impl Display for OptBlockError
impl Display for OptBlockError
Source§impl Error for OptBlockError
impl Error for OptBlockError
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()