Error

Enum Error 

Source
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.

Fields

§

Expected

Expected a specific token or value.

Fields

§msg: &'static str
§

InvalidChar

Invalid character encountered.

Fields

§char: char
§

MaxStrLength

String length exceeds the maximum allowed length.

Fields

§max: usize
§

Version

Version-related error.

Fields

§msg: &'static str
§

Message

Message-related error.

Fields

§msg: &'static str
§

Receivers

Receivers-related error.

Fields

§msg: &'static str
§

Nodes

Nodes-related error.

Fields

§msg: &'static str
§

Signal

Signal-related error.

Fields

§msg: &'static str
§

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

Source

pub fn unexpected_eof() -> Self

Create an UnexpectedEof error without line info.

Source

pub fn unexpected_eof_at(line: usize) -> Self

Create an UnexpectedEof error with line info.

Source

pub fn expected(msg: &'static str) -> Self

Create an Expected error without line info.

Source

pub fn expected_at(msg: &'static str, line: usize) -> Self

Create an Expected error with line info.

Source

pub fn invalid_char(char: char) -> Self

Create an InvalidChar error without line info.

Source

pub fn invalid_char_at(char: char, line: usize) -> Self

Create an InvalidChar error with line info.

Source

pub fn max_str_length(max: usize) -> Self

Create a MaxStrLength error without line info.

Source

pub fn max_str_length_at(max: usize, line: usize) -> Self

Create a MaxStrLength error with line info.

Source

pub fn version(msg: &'static str) -> Self

Create a Version error without line info.

Source

pub fn version_at(msg: &'static str, line: usize) -> Self

Create a Version error with line info.

Source

pub fn message(msg: &'static str) -> Self

Create a Message error without line info.

Source

pub fn message_at(msg: &'static str, line: usize) -> Self

Create a Message error with line info.

Source

pub fn receivers(msg: &'static str) -> Self

Create a Receivers error without line info.

Source

pub fn receivers_at(msg: &'static str, line: usize) -> Self

Create a Receivers error with line info.

Source

pub fn nodes(msg: &'static str) -> Self

Create a Nodes error without line info.

Source

pub fn nodes_at(msg: &'static str, line: usize) -> Self

Create a Nodes error with line info.

Source

pub fn signal(msg: &'static str) -> Self

Create a Signal error without line info.

Source

pub fn signal_at(msg: &'static str, line: usize) -> Self

Create a Signal error with line info.

Source

pub fn line(&self) -> Option<usize>

Get the line number associated with this error, if any.

Source

pub fn with_line(self, line: usize) -> Self

Add line number information to an error. If the error already has line info, it is preserved.

Source§

impl Error

Source

pub const UNEXPECTED_EOF: &'static str = lang::UNEXPECTED_EOF

Source

pub const EXPECTED_WHITESPACE: &'static str = lang::EXPECTED_WHITESPACE

Source

pub const EXPECTED_PATTERN: &'static str = lang::EXPECTED_PATTERN

Source

pub const EXPECTED_KEYWORD: &'static str = lang::EXPECTED_KEYWORD

Source

pub const EXPECTED_NUMBER: &'static str = lang::EXPECTED_NUMBER

Source

pub const EXPECTED_IDENTIFIER: &'static str = lang::EXPECTED_IDENTIFIER

Source

pub const INVALID_UTF8: &'static str = lang::INVALID_UTF8

Source

pub const INVALID_NUMBER_FORMAT: &'static str = lang::INVALID_NUMBER_FORMAT

Source

pub const PARSE_NUMBER_FAILED: &'static str = lang::PARSE_NUMBER_FAILED

Source

pub const INVALID_CHARACTER: &'static str = lang::INVALID_CHARACTER

Source

pub const STRING_LENGTH_EXCEEDS_MAX: &'static str = lang::STRING_LENGTH_EXCEEDS_MAX

Source

pub const MAX_NAME_SIZE_EXCEEDED: &'static str = lang::MAX_NAME_SIZE_EXCEEDED

Source

pub const DECODING_ERROR_PREFIX: &'static str = lang::DECODING_ERROR_PREFIX

Source

pub const VALIDATION_ERROR_PREFIX: &'static str = lang::VALIDATION_ERROR_PREFIX

Source

pub const VERSION_ERROR_PREFIX: &'static str = lang::VERSION_ERROR_PREFIX

Source

pub const MESSAGE_ERROR_PREFIX: &'static str = lang::MESSAGE_ERROR_PREFIX

Source

pub const RECEIVERS_ERROR_PREFIX: &'static str = lang::RECEIVERS_ERROR_PREFIX

Source

pub const NODES_ERROR_PREFIX: &'static str = lang::NODES_ERROR_PREFIX

Source

pub const SIGNAL_ERROR_PREFIX: &'static str = lang::SIGNAL_ERROR_PREFIX

Source

pub const SIGNAL_PARSE_INVALID_START_BIT: &'static str = lang::SIGNAL_PARSE_INVALID_START_BIT

Source

pub const SIGNAL_PARSE_INVALID_LENGTH: &'static str = lang::SIGNAL_PARSE_INVALID_LENGTH

Source

pub const SIGNAL_PARSE_INVALID_FACTOR: &'static str = lang::SIGNAL_PARSE_INVALID_FACTOR

Source

pub const SIGNAL_PARSE_INVALID_OFFSET: &'static str = lang::SIGNAL_PARSE_INVALID_OFFSET

Source

pub const SIGNAL_PARSE_INVALID_MIN: &'static str = lang::SIGNAL_PARSE_INVALID_MIN

Source

pub const SIGNAL_PARSE_INVALID_MAX: &'static str = lang::SIGNAL_PARSE_INVALID_MAX

Source

pub const SIGNAL_PARSE_UNIT_TOO_LONG: &'static str = lang::SIGNAL_PARSE_UNIT_TOO_LONG

Source

pub const SIGNAL_NAME_EMPTY: &'static str = lang::SIGNAL_NAME_EMPTY

Source

pub const SIGNAL_LENGTH_TOO_SMALL: &'static str = lang::SIGNAL_LENGTH_TOO_SMALL

Source

pub const SIGNAL_LENGTH_TOO_LARGE: &'static str = lang::SIGNAL_LENGTH_TOO_LARGE

Source

pub const SIGNAL_LENGTH_REQUIRED: &'static str = lang::SIGNAL_LENGTH_REQUIRED

Source

pub const SIGNAL_START_BIT_REQUIRED: &'static str = lang::SIGNAL_START_BIT_REQUIRED

Source

pub const SIGNAL_BYTE_ORDER_REQUIRED: &'static str = lang::SIGNAL_BYTE_ORDER_REQUIRED

Source

pub const SIGNAL_UNSIGNED_REQUIRED: &'static str = lang::SIGNAL_UNSIGNED_REQUIRED

Source

pub const SIGNAL_FACTOR_REQUIRED: &'static str = lang::SIGNAL_FACTOR_REQUIRED

Source

pub const SIGNAL_OFFSET_REQUIRED: &'static str = lang::SIGNAL_OFFSET_REQUIRED

Source

pub const SIGNAL_MIN_REQUIRED: &'static str = lang::SIGNAL_MIN_REQUIRED

Source

pub const SIGNAL_MAX_REQUIRED: &'static str = lang::SIGNAL_MAX_REQUIRED

Source

pub const SIGNAL_OVERLAP: &'static str = lang::SIGNAL_OVERLAP

Source

pub const SIGNAL_EXTENDS_BEYOND_MESSAGE: &'static str = lang::SIGNAL_EXTENDS_BEYOND_MESSAGE

Source

pub const SIGNAL_EXTENDS_BEYOND_DATA: &'static str = lang::SIGNAL_EXTENDS_BEYOND_DATA

Source

pub const SIGNAL_RECEIVERS_TOO_MANY: &'static str = lang::SIGNAL_RECEIVERS_TOO_MANY

Source

pub const NODES_DUPLICATE_NAME: &'static str = lang::NODES_DUPLICATE_NAME

Source

pub const NODES_TOO_MANY: &'static str = lang::NODES_TOO_MANY

Source

pub const DUPLICATE_MESSAGE_ID: &'static str = lang::DUPLICATE_MESSAGE_ID

Source

pub const SENDER_NOT_IN_NODES: &'static str = lang::SENDER_NOT_IN_NODES

Source

pub const INVALID_RANGE: &'static str = lang::INVALID_RANGE

Source

pub const MESSAGE_TOO_MANY_SIGNALS: &'static str = lang::MESSAGE_TOO_MANY_SIGNALS

Source

pub const EXTENDED_MULTIPLEXING_TOO_MANY: &'static str = lang::EXTENDED_MULTIPLEXING_TOO_MANY

Source

pub const MESSAGE_NAME_EMPTY: &'static str = lang::MESSAGE_NAME_EMPTY

Source

pub const MESSAGE_SENDER_EMPTY: &'static str = lang::MESSAGE_SENDER_EMPTY

Source

pub const MESSAGE_DLC_TOO_SMALL: &'static str = lang::MESSAGE_DLC_TOO_SMALL

Source

pub const MESSAGE_DLC_TOO_LARGE: &'static str = lang::MESSAGE_DLC_TOO_LARGE

Source

pub const MESSAGE_DLC_REQUIRED: &'static str = lang::MESSAGE_DLC_REQUIRED

Source

pub const MESSAGE_ID_OUT_OF_RANGE: &'static str = lang::MESSAGE_ID_OUT_OF_RANGE

Source

pub const MESSAGE_ID_REQUIRED: &'static str = lang::MESSAGE_ID_REQUIRED

Source

pub const MESSAGE_INVALID_ID: &'static str = lang::MESSAGE_INVALID_ID

Source

pub const MESSAGE_INVALID_DLC: &'static str = lang::MESSAGE_INVALID_DLC

Source

pub const MESSAGE_NOT_FOUND: &'static str = lang::MESSAGE_NOT_FOUND

Source

pub const PAYLOAD_LENGTH_MISMATCH: &'static str = lang::PAYLOAD_LENGTH_MISMATCH

Source

pub const MULTIPLEXER_SWITCH_NEGATIVE: &'static str = lang::MULTIPLEXER_SWITCH_NEGATIVE

Source

pub const RECEIVERS_DUPLICATE_NAME: &'static str = lang::RECEIVERS_DUPLICATE_NAME

Source

pub const VALUE_DESCRIPTION_MESSAGE_NOT_FOUND: &'static str = lang::VALUE_DESCRIPTION_MESSAGE_NOT_FOUND

Source

pub const VALUE_DESCRIPTION_SIGNAL_NOT_FOUND: &'static str = lang::VALUE_DESCRIPTION_SIGNAL_NOT_FOUND

Source

pub const VALUE_DESCRIPTIONS_TOO_MANY: &'static str = lang::VALUE_DESCRIPTIONS_TOO_MANY

Source

pub const VALUE_DESCRIPTIONS_EMPTY: &'static str = lang::VALUE_DESCRIPTIONS_EMPTY

Source

pub const EXT_MUX_MESSAGE_NOT_FOUND: &'static str = lang::EXT_MUX_MESSAGE_NOT_FOUND

Source

pub const EXT_MUX_SIGNAL_NOT_FOUND: &'static str = lang::EXT_MUX_SIGNAL_NOT_FOUND

Source

pub const EXT_MUX_SWITCH_NOT_FOUND: &'static str = lang::EXT_MUX_SWITCH_NOT_FOUND

Source

pub const EXT_MUX_INVALID_RANGE: &'static str = lang::EXT_MUX_INVALID_RANGE

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Available on crate feature std only.
Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ParseIntError> for Error

Source§

fn from(_err: ParseIntError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Error) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.