Skip to main content

ValidationError

Enum ValidationError 

Source
pub enum ValidationError {
Show 15 variants UnknownMatterCode(String), MalformedCode { part: MatterPart, found: String, }, MissingSoft { code: String, }, IncorrectSoftLength { code: String, expected: usize, found: usize, }, InvalidSoftFormat { code: String, }, MissingRaw { code: String, }, UnexpectedRaw { code: String, }, IncorrectRawSize { code: String, expected: usize, found: usize, }, IncompatiblePromotion(String), InvalidPromotionTarget { code: String, lead: usize, }, InvalidPromotionResult { from: String, to: String, }, InvalidSizingOperation(String), NonCanonicalEncoding(MatterPart), StructuralIntegrityError, SizeOverflow,
}
Available on crate feature core only.
Expand description

Errors produced while validating Matter builder inputs.

Variants§

§

UnknownMatterCode(String)

The code string does not correspond to a known Matter code.

§

MalformedCode

A structural component of the code was malformed.

Fields

§part: MatterPart

Which structural part was malformed.

§found: String

The invalid content that was found.

§

MissingSoft

The code requires a soft field but none was provided.

Fields

§code: String

The CESR code that requires a soft field.

§

IncorrectSoftLength

The soft field has the wrong length for the given code.

Fields

§code: String

The CESR code.

§expected: usize

Expected soft field length.

§found: usize

Actual soft field length found.

§

InvalidSoftFormat

The soft field contains non-Base64 characters.

Fields

§code: String

The CESR code.

§

MissingRaw

The code requires raw data but none was provided.

Fields

§code: String

The CESR code.

§

UnexpectedRaw

Raw data was provided for a code that has no raw payload.

Fields

§code: String

The CESR code.

§

IncorrectRawSize

The raw data length does not match the code’s expected size.

Fields

§code: String

The CESR code.

§expected: usize

Expected number of raw bytes.

§found: usize

Actual number of raw bytes found.

§

IncompatiblePromotion(String)

A fixed-size code was used where a variable-size promotion is required.

§

InvalidPromotionTarget

The requested promotion for the given code and lead size is not a valid CESR transformation.

Fields

§code: String

The CESR code being promoted.

§lead: usize

The lead size that was requested.

§

InvalidPromotionResult

The result of a code promotion was invalid or unknown.

Fields

§from: String

The source code.

§to: String

The target code.

§

InvalidSizingOperation(String)

Cannot determine a fixed raw size for a variable-size code.

§

NonCanonicalEncoding(MatterPart)

Non-canonical encoding: padding bits in the given part were non-zero.

§

StructuralIntegrityError

The parsed components do not add up to the expected total length.

§

SizeOverflow

Computing the primitive’s full size from the decoded soft field overflowed usize. The soft field is attacker-controlled; a declared size this large cannot describe a real frame, so it is rejected rather than wrapped.

Trait Implementations§

Source§

impl Debug for ValidationError

Source§

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

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

impl Display for ValidationError

Source§

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

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

impl Eq for ValidationError

Source§

impl Error for ValidationError

1.30.0 · 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<ValidationError> for MatterBuildError

Source§

fn from(source: ValidationError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ValidationError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ValidationError

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.