#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
SyncWordMismatch {
expected: [u8; 2],
found: [u8; 2],
},
InvalidValue {
field: &'static str,
value: u8,
reason: &'static str,
},
InvalidBinaryGroup {
index: usize,
value: u8,
},
}Expand description
An LTC codeword parse / serialize error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BufferTooShort
Input (on parse) or output buffer (on serialize) shorter than the fixed 10-byte (80-bit) LTC codeword.
Fields
SyncWordMismatch
Bits 64–79 did not match the fixed synchronization word (§9.2.5,
Table 5: bytes 0xFC 0xBF under this crate’s bit-to-byte packing —
see docs/st12-1.md’s “Byte packing convention” section).
Fields
§
expected: [u8; 2]The fixed sync word bytes (see crate::SYNC_WORD).
InvalidValue
A time-address field (hours/minutes/seconds/frames) exceeded
its valid range (§5.2/§6.2/§7.2, §9.2.1 Table 2).
Fields
InvalidBinaryGroup
One of the eight 4-bit binary groups (“user bits”, §8.1/Table 4) held
a value outside 0x0..=0xF.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Mutably borrows from an owned value. Read more