AutosarDataError

Enum AutosarDataError 

Source
#[non_exhaustive]
pub enum AutosarDataError {
Show 31 variants IoErrorRead { filename: PathBuf, ioerror: Error, }, IoErrorOpen { filename: PathBuf, ioerror: Error, }, IoErrorWrite { filename: PathBuf, ioerror: Error, }, DuplicateFilenameError { verb: &'static str, filename: PathBuf, }, LexerError { filename: PathBuf, line: usize, source: ArxmlLexerError, }, ParserError { filename: PathBuf, line: usize, source: ArxmlParserError, }, OverlappingDataError { filename: PathBuf, path: String, }, ItemDeleted, InvalidPosition, VersionMismatch { version_cur: AutosarVersion, version_new: AutosarVersion, }, VersionIncompatibleData { version: AutosarVersion, }, ElementNotIdentifiable { xmlpath: String, }, ItemNameRequired { element: ElementName, }, IncorrectContentType { element: ElementName, }, ElementInsertionConflict { parent: ElementName, element: ElementName, parent_path: String, }, InvalidSubElement { parent: ElementName, element: ElementName, }, ElementNotFound { target: ElementName, parent: ElementName, }, ShortNameRemovalForbidden, NotReferenceElement, InvalidReference, DuplicateItemName { element: ElementName, item_name: String, }, ForbiddenMoveToSubElement, ForbiddenCopyOfParent, ParentElementLocked, InvalidAttribute, InvalidAttributeValue, InvalidFile, EmptyFile, InvalidFileMerge { path: String, }, NoFilesInModel, FilesetModificationForbidden,
}
Expand description

The error type AutosarDataError wraps all errors that can be generated anywhere in the crate

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

IoErrorRead

IoErrorRead: An IoError that occurred while reading a file

Fields

§filename: PathBuf

The filename that caused the error

§ioerror: Error

The underlying std::io::Error

§

IoErrorOpen

IoErrorOpen: an IoError that occurres while opening a file

Fields

§filename: PathBuf

The filename that caused the error

§ioerror: Error

The underlying std::io::Error

§

IoErrorWrite

IoErrorWrite: An IoError that occurred while writing a file

Fields

§filename: PathBuf

The filename that caused the error

§ioerror: Error

The underlying std::io::Error

§

DuplicateFilenameError

DuplicateFilenameError: The model can’#’t contain two files with identical names

Fields

§verb: &'static str

description of the operation that failed

§filename: PathBuf

The filename that caused the error

§

LexerError

LexerError: An error originating in the lexer, such as unclodes strings, mismatched ‘<’ and ‘>’, etc

Fields

§filename: PathBuf

The filename that caused the error

§line: usize

The line number where the error occurred

§source: ArxmlLexerError

The underlying ArxmlLexerError

§

ParserError

ParserError: A parser error

Fields

§filename: PathBuf

The filename that caused the error

§line: usize

The line number where the error occurred

§source: ArxmlParserError

The underlying ArxmlParserError

§

OverlappingDataError

A file could not be loaded into the model, because the Autosar paths of the new data overlapped with the Autosar paths of the existing data

Fields

§filename: PathBuf

The filename that caused the error

§path: String

Autosar path of the element that caused the error

§

ItemDeleted

An operation failed because one of the elements involved is in the deleted state and will be freed once its reference count reaches zero

§

InvalidPosition

A sub element could not be created at or moved to the given position

§

VersionMismatch

The Autosar version of the new file or element did not match the version already in use

Fields

§version_cur: AutosarVersion

The current version of the model

§version_new: AutosarVersion

The version of the new file or element

§

VersionIncompatibleData

The Autosar version is not compatible with the data

Fields

§version: AutosarVersion

The incompatible version

§

ElementNotIdentifiable

A function that only applies to identifiable elements was called on an element which is not identifiable

Fields

§xmlpath: String

The “xml path” (a string representation of the path to the element) where the error occurred

§

ItemNameRequired

An item name is required to perform this action

Fields

§element: ElementName

The element where the item name is required

§

IncorrectContentType

The element has the wrong content type for the requested operation, e.g. inserting elements when the content type only allows character data

Fields

§element: ElementName

The element where the content type is incorrect

§

ElementInsertionConflict

Could not insert a sub element, because it conflicts with an existing sub element

Fields

§parent: ElementName

The name of the parent element

§element: ElementName

The name of the element that could not be inserted

§parent_path: String

path of the parent element

§

InvalidSubElement

The ElementName is not a valid sub element according to the specification.

Fields

§parent: ElementName

The name of the parent element

§element: ElementName

The name of the element that is not a valid sub element

§

ElementNotFound

Remove operation failed: the given element is not a sub element of the element from which it was supposed to be removed

Fields

§target: ElementName

The name of the element that was not found

§parent: ElementName

The name of the parent element

§

ShortNameRemovalForbidden

Element::remove_sub_element cannot remove the SHORT-NAME of identifiable elements, as this would render the data invalid

§

NotReferenceElement

get/set reference target was called for an element that is not a reference

§

InvalidReference

The reference is invalid

§

DuplicateItemName

An element could not be renamed, since this item name is already used by a different element

Fields

§element: ElementName

The name of the element that could not be renamed

§item_name: String

The target name that caused the error

§

ForbiddenMoveToSubElement

Cannot move an element into its own sub element

§

ForbiddenCopyOfParent

Cannot copy an element (or a hierarchy including the element) into itself

§

ParentElementLocked

A parent element is currently locked by a different operation. The operation wa aborted to avoid a deadlock.

§

InvalidAttribute

The attribute is invalid here

§

InvalidAttributeValue

The attribute value is invalid

§

InvalidFile

The file is from a different model and may not be used in this operation

§

EmptyFile

The file is empty and cannot be serialized

§

InvalidFileMerge

The newly loaded file diverges from the combined model on an element which is not splittable according to the metamodel

Fields

§path: String

The path of the element where the merge failed

§

NoFilesInModel

The operation cannot be completed because the model does not contain any files

§

FilesetModificationForbidden

Modifying the fileset of this element is not allowed

Trait Implementations§

Source§

impl Debug for AutosarDataError

Source§

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

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

impl Display for AutosarDataError

Source§

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

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

impl Error for AutosarDataError

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.