pub enum Error {
UnexpectedEof {
line: Option<usize>,
},
Expected {
msg: &'static str,
line: Option<usize>,
},
InvalidChar {
char: char,
line: Option<usize>,
},
MaxStrLength {
max: usize,
line: Option<usize>,
},
Version {
msg: &'static str,
line: Option<usize>,
},
Message {
msg: &'static str,
line: Option<usize>,
},
Receivers {
msg: &'static str,
line: Option<usize>,
},
Nodes {
msg: &'static str,
line: Option<usize>,
},
Signal {
msg: &'static str,
line: Option<usize>,
},
Decoding(&'static str),
Validation(&'static str),
}Expand description
Error type for DBC operations.
This enum represents all possible errors that can occur when working with DBC files. Parsing errors include line number information to help locate issues in the source file.
Variants§
UnexpectedEof
Unexpected end of input encountered.
Expected
Expected a specific token or value.
InvalidChar
Invalid character encountered.
MaxStrLength
String length exceeds the maximum allowed length.
Version
Version-related error.
Message
Message-related error.
Receivers
Receivers-related error.
Nodes
Nodes-related error.
Signal
Signal-related error.
Decoding(&'static str)
Decoding-related error (runtime, no line info).
Validation(&'static str)
Validation-related error (post-parse, no line info).
Implementations§
Source§impl Error
impl Error
Sourcepub fn unexpected_eof() -> Self
pub fn unexpected_eof() -> Self
Create an UnexpectedEof error without line info.
Sourcepub fn unexpected_eof_at(line: usize) -> Self
pub fn unexpected_eof_at(line: usize) -> Self
Create an UnexpectedEof error with line info.
Sourcepub fn expected_at(msg: &'static str, line: usize) -> Self
pub fn expected_at(msg: &'static str, line: usize) -> Self
Create an Expected error with line info.
Sourcepub fn invalid_char(char: char) -> Self
pub fn invalid_char(char: char) -> Self
Create an InvalidChar error without line info.
Sourcepub fn invalid_char_at(char: char, line: usize) -> Self
pub fn invalid_char_at(char: char, line: usize) -> Self
Create an InvalidChar error with line info.
Sourcepub fn max_str_length(max: usize) -> Self
pub fn max_str_length(max: usize) -> Self
Create a MaxStrLength error without line info.
Sourcepub fn max_str_length_at(max: usize, line: usize) -> Self
pub fn max_str_length_at(max: usize, line: usize) -> Self
Create a MaxStrLength error with line info.
Sourcepub fn version_at(msg: &'static str, line: usize) -> Self
pub fn version_at(msg: &'static str, line: usize) -> Self
Create a Version error with line info.
Sourcepub fn message_at(msg: &'static str, line: usize) -> Self
pub fn message_at(msg: &'static str, line: usize) -> Self
Create a Message error with line info.
Sourcepub fn receivers_at(msg: &'static str, line: usize) -> Self
pub fn receivers_at(msg: &'static str, line: usize) -> Self
Create a Receivers error with line info.
Source§impl Error
impl Error
pub const UNEXPECTED_EOF: &'static str = lang::UNEXPECTED_EOF
pub const EXPECTED_WHITESPACE: &'static str = lang::EXPECTED_WHITESPACE
pub const EXPECTED_PATTERN: &'static str = lang::EXPECTED_PATTERN
pub const EXPECTED_KEYWORD: &'static str = lang::EXPECTED_KEYWORD
pub const EXPECTED_NUMBER: &'static str = lang::EXPECTED_NUMBER
pub const EXPECTED_IDENTIFIER: &'static str = lang::EXPECTED_IDENTIFIER
pub const INVALID_UTF8: &'static str = lang::INVALID_UTF8
pub const INVALID_NUMBER_FORMAT: &'static str = lang::INVALID_NUMBER_FORMAT
pub const PARSE_NUMBER_FAILED: &'static str = lang::PARSE_NUMBER_FAILED
pub const INVALID_CHARACTER: &'static str = lang::INVALID_CHARACTER
pub const STRING_LENGTH_EXCEEDS_MAX: &'static str = lang::STRING_LENGTH_EXCEEDS_MAX
pub const MAX_NAME_SIZE_EXCEEDED: &'static str = lang::MAX_NAME_SIZE_EXCEEDED
pub const DECODING_ERROR_PREFIX: &'static str = lang::DECODING_ERROR_PREFIX
pub const VALIDATION_ERROR_PREFIX: &'static str = lang::VALIDATION_ERROR_PREFIX
pub const VERSION_ERROR_PREFIX: &'static str = lang::VERSION_ERROR_PREFIX
pub const MESSAGE_ERROR_PREFIX: &'static str = lang::MESSAGE_ERROR_PREFIX
pub const RECEIVERS_ERROR_PREFIX: &'static str = lang::RECEIVERS_ERROR_PREFIX
pub const NODES_ERROR_PREFIX: &'static str = lang::NODES_ERROR_PREFIX
pub const SIGNAL_ERROR_PREFIX: &'static str = lang::SIGNAL_ERROR_PREFIX
pub const SIGNAL_PARSE_INVALID_START_BIT: &'static str = lang::SIGNAL_PARSE_INVALID_START_BIT
pub const SIGNAL_PARSE_INVALID_LENGTH: &'static str = lang::SIGNAL_PARSE_INVALID_LENGTH
pub const SIGNAL_PARSE_INVALID_FACTOR: &'static str = lang::SIGNAL_PARSE_INVALID_FACTOR
pub const SIGNAL_PARSE_INVALID_OFFSET: &'static str = lang::SIGNAL_PARSE_INVALID_OFFSET
pub const SIGNAL_PARSE_INVALID_MIN: &'static str = lang::SIGNAL_PARSE_INVALID_MIN
pub const SIGNAL_PARSE_INVALID_MAX: &'static str = lang::SIGNAL_PARSE_INVALID_MAX
pub const SIGNAL_PARSE_UNIT_TOO_LONG: &'static str = lang::SIGNAL_PARSE_UNIT_TOO_LONG
pub const SIGNAL_NAME_EMPTY: &'static str = lang::SIGNAL_NAME_EMPTY
pub const SIGNAL_LENGTH_TOO_SMALL: &'static str = lang::SIGNAL_LENGTH_TOO_SMALL
pub const SIGNAL_LENGTH_TOO_LARGE: &'static str = lang::SIGNAL_LENGTH_TOO_LARGE
pub const SIGNAL_LENGTH_REQUIRED: &'static str = lang::SIGNAL_LENGTH_REQUIRED
pub const SIGNAL_START_BIT_REQUIRED: &'static str = lang::SIGNAL_START_BIT_REQUIRED
pub const SIGNAL_BYTE_ORDER_REQUIRED: &'static str = lang::SIGNAL_BYTE_ORDER_REQUIRED
pub const SIGNAL_UNSIGNED_REQUIRED: &'static str = lang::SIGNAL_UNSIGNED_REQUIRED
pub const SIGNAL_FACTOR_REQUIRED: &'static str = lang::SIGNAL_FACTOR_REQUIRED
pub const SIGNAL_OFFSET_REQUIRED: &'static str = lang::SIGNAL_OFFSET_REQUIRED
pub const SIGNAL_MIN_REQUIRED: &'static str = lang::SIGNAL_MIN_REQUIRED
pub const SIGNAL_MAX_REQUIRED: &'static str = lang::SIGNAL_MAX_REQUIRED
pub const SIGNAL_OVERLAP: &'static str = lang::SIGNAL_OVERLAP
pub const SIGNAL_EXTENDS_BEYOND_MESSAGE: &'static str = lang::SIGNAL_EXTENDS_BEYOND_MESSAGE
pub const SIGNAL_EXTENDS_BEYOND_DATA: &'static str = lang::SIGNAL_EXTENDS_BEYOND_DATA
pub const SIGNAL_RECEIVERS_TOO_MANY: &'static str = lang::SIGNAL_RECEIVERS_TOO_MANY
pub const NODES_DUPLICATE_NAME: &'static str = lang::NODES_DUPLICATE_NAME
pub const NODES_TOO_MANY: &'static str = lang::NODES_TOO_MANY
pub const DUPLICATE_MESSAGE_ID: &'static str = lang::DUPLICATE_MESSAGE_ID
pub const SENDER_NOT_IN_NODES: &'static str = lang::SENDER_NOT_IN_NODES
pub const INVALID_RANGE: &'static str = lang::INVALID_RANGE
pub const MESSAGE_TOO_MANY_SIGNALS: &'static str = lang::MESSAGE_TOO_MANY_SIGNALS
pub const EXTENDED_MULTIPLEXING_TOO_MANY: &'static str = lang::EXTENDED_MULTIPLEXING_TOO_MANY
pub const MESSAGE_NAME_EMPTY: &'static str = lang::MESSAGE_NAME_EMPTY
pub const MESSAGE_SENDER_EMPTY: &'static str = lang::MESSAGE_SENDER_EMPTY
pub const MESSAGE_DLC_TOO_SMALL: &'static str = lang::MESSAGE_DLC_TOO_SMALL
pub const MESSAGE_DLC_TOO_LARGE: &'static str = lang::MESSAGE_DLC_TOO_LARGE
pub const MESSAGE_DLC_REQUIRED: &'static str = lang::MESSAGE_DLC_REQUIRED
pub const MESSAGE_ID_OUT_OF_RANGE: &'static str = lang::MESSAGE_ID_OUT_OF_RANGE
pub const MESSAGE_ID_REQUIRED: &'static str = lang::MESSAGE_ID_REQUIRED
pub const MESSAGE_INVALID_ID: &'static str = lang::MESSAGE_INVALID_ID
pub const MESSAGE_INVALID_DLC: &'static str = lang::MESSAGE_INVALID_DLC
pub const MESSAGE_NOT_FOUND: &'static str = lang::MESSAGE_NOT_FOUND
pub const PAYLOAD_LENGTH_MISMATCH: &'static str = lang::PAYLOAD_LENGTH_MISMATCH
pub const MULTIPLEXER_SWITCH_NEGATIVE: &'static str = lang::MULTIPLEXER_SWITCH_NEGATIVE
pub const RECEIVERS_DUPLICATE_NAME: &'static str = lang::RECEIVERS_DUPLICATE_NAME
pub const VALUE_DESCRIPTION_MESSAGE_NOT_FOUND: &'static str = lang::VALUE_DESCRIPTION_MESSAGE_NOT_FOUND
pub const VALUE_DESCRIPTION_SIGNAL_NOT_FOUND: &'static str = lang::VALUE_DESCRIPTION_SIGNAL_NOT_FOUND
pub const VALUE_DESCRIPTIONS_TOO_MANY: &'static str = lang::VALUE_DESCRIPTIONS_TOO_MANY
pub const VALUE_DESCRIPTIONS_EMPTY: &'static str = lang::VALUE_DESCRIPTIONS_EMPTY
pub const EXT_MUX_MESSAGE_NOT_FOUND: &'static str = lang::EXT_MUX_MESSAGE_NOT_FOUND
pub const EXT_MUX_SIGNAL_NOT_FOUND: &'static str = lang::EXT_MUX_SIGNAL_NOT_FOUND
pub const EXT_MUX_SWITCH_NOT_FOUND: &'static str = lang::EXT_MUX_SWITCH_NOT_FOUND
pub const EXT_MUX_INVALID_RANGE: &'static str = lang::EXT_MUX_INVALID_RANGE
Trait Implementations§
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(_err: ParseIntError) -> Self
fn from(_err: ParseIntError) -> Self
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 UnwindSafe for Error
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)