ArxmlParserError

Enum ArxmlParserError 

Source
#[non_exhaustive]
pub enum ArxmlParserError {
Show 27 variants InvalidArxmlFileHeader, UnexpectedXmlFileHeader { element: ElementName, }, UnknownAutosarVersion { input_verstring: String, }, InvalidAutosarVersion { input_verstring: String, replacement: AutosarVersion, }, IncorrectBeginElement { element: ElementName, sub_element: ElementName, }, InvalidBeginElement { element: ElementName, invalid_element: String, }, IncorrectEndElement { element: ElementName, other_element: ElementName, }, InvalidEndElement { parent_element: ElementName, invalid_element: String, }, ElementChoiceConflict { element: ElementName, sub_element: ElementName, }, ElementVersionError { element: ElementName, sub_element: ElementName, version: AutosarVersion, }, TooManySubElements { element: ElementName, sub_element: ElementName, }, RequiredSubelementMissing { element: ElementName, sub_element: ElementName, }, AttributeValueError { element: ElementName, attribute_text: String, }, UnknownAttributeError { element: ElementName, attribute: String, }, AttributeVersionError { element: ElementName, attribute: AttributeName, version: AutosarVersion, }, RequiredAttributeMissing { element: ElementName, attribute: AttributeName, }, CharacterContentForbidden { element: ElementName, }, EnumItemVersionError { element: ElementName, enum_item: EnumItem, version: AutosarVersion, }, UnknownEnumItem { value: String, }, InvalidEnumItem { element: ElementName, item: EnumItem, }, StringValueTooLong { value: String, length: usize, }, RegexMatchError { value: String, regex: String, }, Utf8Error { source: Utf8Error, }, UnexpectedEndOfFile { element: ElementName, }, InvalidNumber { input: String, }, AdditionalDataError, InvalidXmlEntity { input: String, },
}
Expand description

ArxmlParserError contains all the errors that can occur while parsing a file

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

InvalidArxmlFileHeader

The arxml file header is invalid

§

UnexpectedXmlFileHeader

An XML file header was unexpectedly found inside the ARXML data

Fields

§element: ElementName

The element that was open when the unexpected XML file header was found

§

UnknownAutosarVersion

The file version in the xsi:schemaLocation attribute is unknown

Fields

§input_verstring: String

The version string that was found in the file header

§

InvalidAutosarVersion

The file version in the xsi:schemaLocation attribute is invalid, but can be corrected

Fields

§input_verstring: String

The version string that was found in the file header

§replacement: AutosarVersion

The corrected version

§

IncorrectBeginElement

A valid name of an Autosar element was found, but it is not allowed in the current context

Fields

§element: ElementName

The parent element where the error occurred

§sub_element: ElementName

The unexpected child element

§

InvalidBeginElement

An xml element was found, but it is not a valid Autosar element

Fields

§element: ElementName

The parent element where the error occurred

§invalid_element: String

The name of the invalid child element

§

IncorrectEndElement

An element was opened, but the closing tag for a different element was found

Fields

§element: ElementName

The element that was open when the incorrect closing tag was found

§other_element: ElementName

The name of the element that was closed

§

InvalidEndElement

An xml element was closed, but it is not a valid Autosar element

Fields

§parent_element: ElementName

The parent element where the error occurred

§invalid_element: String

The name of the invalid element that was closed

§

ElementChoiceConflict

A parent element contains multiple sub elements which are mutually exclusive

Fields

§element: ElementName

The parent element where the error occurred

§sub_element: ElementName

The name of the conflicting sub element

§

ElementVersionError

The element contains a sub element that is not allowed in the current Autosar version

Fields

§element: ElementName

The parent element where the error occurred

§sub_element: ElementName

The sub element that is not allowed

§version: AutosarVersion

The Autosar version in which the sub element is not allowed

§

TooManySubElements

A sub element is only allowed to be present once inside a parent element, but another occurrence was found

Fields

§element: ElementName

The parent element where the error occurred

§sub_element: ElementName

The name of the sub element that was found multiple times

§

RequiredSubelementMissing

A required sub element is missing from a parent element

Fields

§element: ElementName

The parent element where the error occurred

§sub_element: ElementName

The name of the missing sub element

§

AttributeValueError

An attribute value yould not be parsed

Fields

§element: ElementName

The element where the error occurred

§attribute_text: String

The attribute text that could not be parsed

§

UnknownAttributeError

An unknown attribute was found in an element

Fields

§element: ElementName

The element where the error occurred

§attribute: String

The name of the unknown attribute

§

AttributeVersionError

A known attribute was found, but it is not allowed in the current Autosar version

Fields

§element: ElementName

The element where the error occurred

§attribute: AttributeName

The name of the attribute that is not allowed

§version: AutosarVersion

The Autosar version in which the attribute is not allowed

§

RequiredAttributeMissing

An attribute is required in an element, but it was not found

Fields

§element: ElementName

The element where the error occurred

§attribute: AttributeName

The name of the missing attribute

§

CharacterContentForbidden

Character content was found inside an element that does not allow it

Fields

§element: ElementName

The element where the error occurred

§

EnumItemVersionError

A valid enum item was found, but it is not allowed in the current autosar version

Fields

§element: ElementName

The element where the error occurred

§enum_item: EnumItem

The enum item that is not allowed

§version: AutosarVersion

The Autosar version in which the enum item is not allowed

§

UnknownEnumItem

A string could not be parsed as a valid enum item

Fields

§value: String

The string that could not be parsed as an enum item

§

InvalidEnumItem

Parsed a valid enum item, but it is not part of the enum in the current context

Fields

§element: ElementName

The element where the error occurred

§item: EnumItem

The invalid enum item

§

StringValueTooLong

The string value is too long

Fields

§value: String

The string that is too long

§length: usize

The maximum allowed length

§

RegexMatchError

The string value does not match the validation regex

Fields

§value: String

The string that does not match the regex

§regex: String

The regex that the string should match

§

Utf8Error

Some bytes from the input could not be converted to a utf-8 string

Fields

§source: Utf8Error

The original error returned by std::str::from_utf8

§

UnexpectedEndOfFile

The end of the input was reached unexpectedly while parsing an element

Fields

§element: ElementName

The element that was open when the end of the file was reached

§

InvalidNumber

A number was expected, but the input could not be parsed as a number

Fields

§input: String

The input that could not be parsed as a number

§

AdditionalDataError

The input contains additional data after the final </AUTOSAR> element

§

InvalidXmlEntity

The input contains an invalid XML entity

Fields

§input: String

The invalid XML entity

Trait Implementations§

Source§

impl Debug for ArxmlParserError

Source§

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

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

impl Display for ArxmlParserError

Source§

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

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

impl Error for ArxmlParserError

Source§

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

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

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

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

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.