#[non_exhaustive]pub enum Error {
Show 21 variants
UnexpectedEnd,
InvalidStart(u8),
InvalidHeader,
MissingStop,
Checksum {
computed: u8,
found: u8,
},
Crc {
block: usize,
computed: u16,
found: u16,
},
InvalidLength,
TooManyExtensions,
ReservedDif(u8),
UnsupportedLvar(u8),
UnsupportedCi(u8),
OutputTooSmall,
UnexpectedLayer(u8),
UnsupportedSecurity(u8),
NoKey,
UnknownFormat(u16),
InvalidFormat,
UnexpectedFragment {
expected: u8,
found: u8,
},
FragmentFromOtherMeter,
Verification(Check),
InvalidAddress(u8),
}Expand description
Everything that can go wrong between the meter’s bytes and a typed record.
Every variant is a property of the input, never of this crate’s state.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEnd
The input ended in the middle of a frame or record.
InvalidStart(u8)
The first byte is not a known frame start (E5, 10, 68).
InvalidHeader
The two length bytes of a long frame differ, or the second 68 is missing.
MissingStop
The stop byte (16) is missing.
Checksum
The wired checksum does not match.
Crc
A wireless block CRC does not match.
Fields
InvalidLength
A length field is inconsistent with the frame.
TooManyExtensions
More than 10 DIFE or VIFE bytes follow one another.
ReservedDif(u8)
A reserved special-function DIF (3F…6F).
UnsupportedLvar(u8)
An LVAR value in a reserved range.
UnsupportedCi(u8)
The CI field announces something this crate does not parse yet.
OutputTooSmall
The output buffer is too small for what is being written.
UnexpectedLayer(u8)
A layer appears where it may not (e.g. a second ELL, or an AFL after the TPL).
UnsupportedSecurity(u8)
The telegram is encrypted with a security mode this crate does not decrypt.
NoKey
No key for this meter in the key lookup.
UnknownFormat(u16)
A compact frame whose layout (format signature) is not known yet: wait for a full
frame of this meter and remember its Format.
InvalidFormat
A compact-frame layout that cannot describe values: a special DIF (manufacturer data, filler) or a plain-text unit in it.
UnexpectedFragment
A fragment that does not continue the message in progress: missing, repeated or
out of order (found is its fragment ID; 0 for a telegram that is not a fragment).
Fields
FragmentFromOtherMeter
A fragment from another meter than the message in progress.
Verification(Check)
Decryption or authentication failed: the check that failed, never the key.
InvalidAddress(u8)
A wired primary address no slave answers from: 251 and 252 are reserved, 255 is the broadcast without reply.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.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()