Skip to main content

SchemaInfo

Struct SchemaInfo 

Source
pub struct SchemaInfo {
Show 17 fields pub element_decl: Option<ElementKey>, pub attribute_decl: Option<AttributeKey>, pub schema_type: Option<TypeKey>, pub member_type: Option<TypeKey>, pub validity: SchemaValidity, pub validation_attempted: ValidationAttempted, pub is_default: bool, pub is_nil: bool, pub content_type: Option<ContentType>, pub typed_value: Option<XmlValue>, pub normalized_value: Option<String>, pub schema_error_codes: Vec<&'static str>, pub notation: Option<NotationKey>, pub deferred_by_cta: bool, pub type_source: Option<TypeSource>, pub cta_selected: bool, pub assertion_outcome: Option<AssertionOutcome>,
}
Expand description

Schema information returned after validating a node

Contains the resolved schema components and validation status for an element or attribute.

Fields§

§element_decl: Option<ElementKey>

The element declaration, if one was found

§attribute_decl: Option<AttributeKey>

The attribute declaration, if one was found

§schema_type: Option<TypeKey>

The resolved schema type (simple or complex)

§member_type: Option<TypeKey>

For union types: the actual member type that matched the value

§validity: SchemaValidity

Validity status

§validation_attempted: ValidationAttempted

How much validation was attempted (PSVI [validation attempted])

§is_default: bool

Whether the value was supplied by a default declaration

§is_nil: bool

Whether the element was declared nil via xsi:nil=“true”

§content_type: Option<ContentType>

Content type of the element (Empty, TextOnly, ElementOnly, Mixed)

§typed_value: Option<XmlValue>

The parsed typed value from simple-type validation

§normalized_value: Option<String>

The whitespace-normalized value (PSVI [schema normalized value])

§schema_error_codes: Vec<&'static str>

Constraint codes from validation errors on this node (PSVI [schema error code])

§notation: Option<NotationKey>

Notation declaration resolved from a NOTATION-typed attribute (PSVI [notation]). Only meaningful on element-end SchemaInfo; always None for attributes.

§deferred_by_cta: bool

Whether this attribute was deferred due to CTA (type alternatives)

§type_source: Option<TypeSource>

How the schema_type was determined (declaration, xsi:type, or CTA)

§cta_selected: bool

Whether CTA evaluation selected a type (even if it matches the declared type)

§assertion_outcome: Option<AssertionOutcome>

Complex-type assertion outcome (XSD 1.1, end-element SchemaInfo only)

Implementations§

Source§

impl SchemaInfo

Source

pub fn empty() -> Self

Create a SchemaInfo with all fields set to None/default

Source

pub fn valid_element( element_decl: ElementKey, schema_type: TypeKey, content_type: ContentType, ) -> Self

Create a SchemaInfo indicating a valid element

Source

pub fn valid_attribute( attribute_decl: AttributeKey, schema_type: TypeKey, ) -> Self

Create a SchemaInfo indicating a valid attribute

Source

pub fn invalid() -> Self

Create a SchemaInfo with Invalid validity

Source

pub fn is_simple_type(&self) -> bool

Returns true if the resolved schema type is a simple type.

Source

pub fn is_complex_type(&self) -> bool

Returns true if the resolved schema type is a complex type.

Trait Implementations§

Source§

impl Clone for SchemaInfo

Source§

fn clone(&self) -> SchemaInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaInfo

Source§

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

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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

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