#[non_exhaustive]pub enum SpiCodecPlanError {
ZeroClock,
ZeroBitsPerSymbol,
BitsPerSymbolTooWide {
bits_per_symbol: u8,
},
PatternOutOfRange {
pattern: u8,
bits_per_symbol: u8,
},
InvalidSymbolWaveform {
pattern: u8,
bits_per_symbol: u8,
},
IdenticalSymbolPatterns {
pattern: u8,
},
TimingOutOfTolerance {
edge: TimingEdge,
actual_ns: u32,
expected_ns: u32,
tolerance_ns: u32,
},
TimingOutOfRange {
edge: TimingEdge,
actual_ns: u32,
minimum_ns: u32,
maximum_ns: u32,
},
BitPeriodTooShort {
actual_ns: u32,
minimum_ns: u32,
},
ResetDurationOverflow {
total_reset_ns: u64,
spi_hz: u32,
},
}Expand description
Errors returned when constructing a SpiCodec or validating an
SpiEncodingPlan against a protocol’s timing limits and
reset-duration arithmetic.
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.
ZeroClock
ZeroBitsPerSymbol
BitsPerSymbolTooWide
PatternOutOfRange
InvalidSymbolWaveform
IdenticalSymbolPatterns
Logical 0 and 1 must produce different wire symbols.
TimingOutOfTolerance
Fields
§
edge: TimingEdgeTimingOutOfRange
A phase violates explicit protocol timing limits.
Fields
§
edge: TimingEdgeBitPeriodTooShort
The complete high-plus-low symbol is shorter than the protocol permits.
ResetDurationOverflow
Reset duration × SPI clock exceeds the u64 fixed-point range used
to compute reset byte counts.
Trait Implementations§
Source§impl Clone for SpiCodecPlanError
impl Clone for SpiCodecPlanError
impl Copy for SpiCodecPlanError
Source§impl Debug for SpiCodecPlanError
impl Debug for SpiCodecPlanError
Source§impl Display for SpiCodecPlanError
impl Display for SpiCodecPlanError
impl Eq for SpiCodecPlanError
Source§impl Error for SpiCodecPlanError
impl Error for SpiCodecPlanError
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()
Source§impl PartialEq for SpiCodecPlanError
impl PartialEq for SpiCodecPlanError
impl StructuralPartialEq for SpiCodecPlanError
Auto Trait Implementations§
impl Freeze for SpiCodecPlanError
impl RefUnwindSafe for SpiCodecPlanError
impl Send for SpiCodecPlanError
impl Sync for SpiCodecPlanError
impl Unpin for SpiCodecPlanError
impl UnsafeUnpin for SpiCodecPlanError
impl UnwindSafe for SpiCodecPlanError
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