oa_gateway_uci::validate::violation

Enum ViolationKind

Source
pub enum ViolationKind {
Show 14 variants Undeclared { element: String, }, Missing { element: String, }, TooFew { element: String, min: u32, found: usize, }, TooMany { element: String, max: u32, found: usize, }, NoAlternative { alternatives: Vec<String>, }, ManyAlternatives { taken: Vec<String>, }, AbstractType { type_name: String, }, UnusableType { type_name: String, reason: String, }, TooDeep, NotEnumerated { value: String, allowed: Vec<String>, total: usize, }, Length { value: String, len: usize, unit: &'static str, requirement: String, }, Range { value: String, requirement: String, }, PatternMismatch { value: String, patterns: Vec<String>, }, NotLexical { value: String, primitive: String, expected: String, },
}
Expand description

How a message departed from the schema. Display text is meant for a log line, not a parser.

Variants§

§

Undeclared

An element the type does not declare.

Fields

§element: String
§

Missing

A required element that is absent.

Fields

§element: String
§

TooFew

Present, but fewer times than minOccurs.

Fields

§element: String
§min: u32
§found: usize
§

TooMany

Present more times than maxOccurs.

Fields

§element: String
§max: u32
§found: usize
§

NoAlternative

An alternation with no branch taken.

Fields

§alternatives: Vec<String>
§

ManyAlternatives

An alternation with more than one branch taken.

Fields

§taken: Vec<String>
§

AbstractType

An abstract type used without naming a concrete one.

Fields

§type_name: String
§

UnusableType

A declared type the schema does not define, or a cyclic chain.

Fields

§type_name: String
§reason: String
§

TooDeep

Nesting past the depth conversion would have refused.

§

NotEnumerated

A value outside the enumeration its type declares.

allowed is a sample, since some enumerations run to hundreds of values.

Fields

§value: String
§allowed: Vec<String>
§total: usize
§

Length

A value of the wrong length.

unit is "characters" for the string types and "octets" for xs:hexBinary, which is the unit XSD’s length facet uses on each.

Fields

§value: String
§len: usize
§unit: &'static str
§requirement: String
§

Range

A number outside the bounds its type declares.

Fields

§value: String
§requirement: String
§

PatternMismatch

A value matching none of the patterns declared at one link of its type’s restriction chain.

Fields

§value: String
§patterns: Vec<String>
§

NotLexical

A value that is not one of the primitive underneath its type at all.

Fields

§value: String
§primitive: String
§expected: String

Trait Implementations§

Source§

impl Clone for ViolationKind

Source§

fn clone(&self) -> ViolationKind

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ViolationKind

Source§

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

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

impl Display for ViolationKind

Source§

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

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

impl PartialEq for ViolationKind

Source§

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

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

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 Eq for ViolationKind

Source§

impl StructuralPartialEq for ViolationKind

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

Uses borrowed data to replace owned data, usually by cloning. 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.