Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 26 variants XmlParseError(DeError), XmlSerializeError(SeError), IoError(Error), FileNotFound { path: String, }, DirectoryNotFound { path: String, }, FileReadError { path: String, reason: String, }, FileWriteError { path: String, reason: String, }, EntityNotFound { entity: String, available: Vec<String>, }, CatalogEntryNotFound { catalog: String, entry: String, }, CatalogNotFound { catalog: String, available: Vec<String>, }, ValidationError { field: String, message: String, }, MissingRequiredField { field: String, }, InvalidValue { field: String, value: String, hint: String, }, OutOfRange { field: String, value: String, min: String, max: String, }, TypeMismatch { field: String, expected: String, actual: String, }, ParameterError { param: String, message: String, }, ParameterNotFound { param: String, available: Vec<String>, }, CircularDependency { cycle: String, }, InvalidXmlStructure { message: String, }, MalformedXml { expected: String, found: String, location: String, }, CatalogError(String), ChoiceGroupError { message: String, }, ParseError { input: String, reason: String, }, ExpressionError { expression: String, reason: String, }, ConstraintViolation { constraint: String, }, InconsistentState { message: String, },
}
Expand description

Main error type for the OpenSCENARIO library

Variants§

§

XmlParseError(DeError)

XML deserialization failures

§

XmlSerializeError(SeError)

XML serialization failures

§

IoError(Error)

File I/O failures

§

FileNotFound

File not found at specified path

Fields

§path: String
§

DirectoryNotFound

Directory not found at specified path

Fields

§path: String
§

FileReadError

Cannot read file

Fields

§path: String
§reason: String
§

FileWriteError

Cannot write file

Fields

§path: String
§reason: String
§

EntityNotFound

Entity reference not found

Fields

§entity: String
§available: Vec<String>
§

CatalogEntryNotFound

Catalog entry not found

Fields

§catalog: String
§entry: String
§

CatalogNotFound

Catalog not found

Fields

§catalog: String
§available: Vec<String>
§

ValidationError

Schema validation failures

Fields

§field: String
§message: String
§

MissingRequiredField

Missing required field

Fields

§field: String
§

InvalidValue

Invalid value for field

Fields

§field: String
§value: String
§hint: String
§

OutOfRange

Value out of expected range

Fields

§field: String
§value: String
§

TypeMismatch

Type mismatch

Fields

§field: String
§expected: String
§actual: String
§

ParameterError

Parameter resolution failures

Fields

§param: String
§message: String
§

ParameterNotFound

Parameter not found

Fields

§param: String
§available: Vec<String>
§

CircularDependency

Circular dependency detected

Fields

§cycle: String
§

InvalidXmlStructure

Invalid XML structure

Fields

§message: String
§

MalformedXml

Malformed XML with location context

Fields

§expected: String
§found: String
§location: String
§

CatalogError(String)

Generic catalog system error

§

ChoiceGroupError

XSD Choice Group parsing errors

Fields

§message: String
§

ParseError

Failed to parse input

Fields

§input: String
§reason: String
§

ExpressionError

Expression evaluation failed

Fields

§expression: String
§reason: String
§

ConstraintViolation

Constraint violation

Fields

§constraint: String
§

InconsistentState

Inconsistent state

Fields

§message: String

Implementations§

Source§

impl Error

Source

pub fn file_not_found(path: &str) -> Self

Create a file not found error

Source

pub fn directory_not_found(path: &str) -> Self

Create a directory not found error

Source

pub fn file_read_error(path: &str, reason: &str) -> Self

Create a file read error

Source

pub fn file_write_error(path: &str, reason: &str) -> Self

Create a file write error

Source

pub fn entity_not_found(entity: &str, available: &[String]) -> Self

Create an entity not found error

Source

pub fn catalog_entry_not_found(catalog: &str, entry: &str) -> Self

Create a catalog entry not found error

Source

pub fn catalog_not_found(catalog: &str, available: &[String]) -> Self

Create a catalog not found error

Source

pub fn validation_error(field: &str, message: &str) -> Self

Create a validation error

Source

pub fn missing_field(field: &str) -> Self

Create a missing required field error

Source

pub fn invalid_value(field: &str, value: &str, hint: &str) -> Self

Create an invalid value error

Source

pub fn out_of_range(field: &str, value: &str, min: &str, max: &str) -> Self

Create an out of range error

Source

pub fn type_mismatch(field: &str, expected: &str, actual: &str) -> Self

Create a type mismatch error

Source

pub fn parameter_error(param: &str, message: &str) -> Self

Create a parameter error

Source

pub fn parameter_not_found(param: &str, available: &[String]) -> Self

Create a parameter not found error

Source

pub fn invalid_xml(message: &str) -> Self

Create an invalid XML structure error

Source

pub fn malformed_xml(expected: &str, found: &str, location: &str) -> Self

Create a malformed XML error with location

Source

pub fn parsing_error(msg: &str, line: usize, col: usize) -> Self

Create a parsing error with location information

Source

pub fn circular_dependency(cycle: &str) -> Self

Create a circular dependency error

Source

pub fn parse_error(input: &str, reason: &str) -> Self

Create a parse error

Source

pub fn expression_error(expression: &str, reason: &str) -> Self

Create an expression error

Source

pub fn constraint_violation(constraint: &str) -> Self

Create a constraint violation error

Source

pub fn catalog_error(message: &str) -> Self

Create a catalog error

Source

pub fn choice_group_error(message: &str) -> Self

Create a choice group error

Source

pub fn with_context(self, context: &str) -> Self

Add context to an error

Trait Implementations§

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, __formatter: &mut Formatter<'_>) -> Result

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

impl Error for Error

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

impl From<DeError> for Error

Source§

fn from(source: DeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<SeError> for Error

Source§

fn from(source: SeError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl !UnwindSafe for Error

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.