pub enum DbcError {
Syntax {
line: usize,
message: String,
},
InvalidId {
raw: u32,
max: u32,
},
ValueOutOfRange {
value: f64,
min: f64,
max: f64,
},
RawOutOfRange {
raw: f64,
bit_length: u8,
},
BufferTooShort {
need: usize,
have: usize,
},
}Expand description
The single crate-level error for parsing and signal coding.
Variants§
Syntax
A grammar violation in the DBC text. line is the 1-based line the
violation was detected on (approximate for multi-line constructs);
message describes what was expected.
Fields
InvalidId
A BO_ identifier is not representable: DBC marks extended frames
with bit 31 (0x8000_0000) and caps the payload at 29 bits; plain
identifiers must fit the 11-bit standard width.
Fields
ValueOutOfRange
A physical value lies outside the signal’s declared [min|max]
range (or is not finite — NaN and infinities are always rejected).
Fields
RawOutOfRange
The scaled raw value does not fit the signal’s bit width and signedness.
BufferTooShort
The buffer is shorter than the signal layout requires.
Trait Implementations§
Source§impl Error for DbcError
impl Error for DbcError
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 DbcError
Auto Trait Implementations§
impl Freeze for DbcError
impl RefUnwindSafe for DbcError
impl Send for DbcError
impl Sync for DbcError
impl Unpin for DbcError
impl UnsafeUnpin for DbcError
impl UnwindSafe for DbcError
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