Skip to main content

IdentQuadruple

Struct IdentQuadruple 

Source
pub struct IdentQuadruple {
    pub ns: Option<NamespaceIdent>,
    pub schema: Option<SchemaIdent>,
    pub name: String,
    pub type_: IdentType,
}
Expand description

Identifier that is used inside the config.

Each element in a XML schema is uniquely identified by the following four values: - The namespace of the element (or no namespace at all). - The schema the element was defined in. - The name of the element. - The type of element.

This struct is used to bundle these three information to a unique identifier for an element.

Fields§

§ns: Option<NamespaceIdent>

Namespace where the type is defined in.

§schema: Option<SchemaIdent>

Id of the schema the type is defined in.

§name: String

Name of the type.

§type_: IdentType

Type of the identifier (because pure names are not unique in XSD).

Implementations§

Source§

impl IdentQuadruple

Source

pub fn new<S>(name: S, type_: IdentType) -> Self
where S: Into<String>,

Create a new IdentQuadruple instance from the passed name and type_.

Source

pub fn with_ns<X>(self, ns: X) -> Self
where X: Into<NamespaceIdent>,

Adds a NamespaceIdent to this identifier quadruple.

Source

pub fn with_schema<X>(self, schema: X) -> Self
where X: Into<SchemaIdent>,

Adds a SchemaIdent to this identifier quadruple.

Source

pub fn with_name<X>(self, name: X) -> Self
where X: Into<String>,

Sets the name of the type that is identified by this identifier quadruple.

Source

pub fn with_type(self, type_: IdentType) -> Self

Sets the identifier type of this identifier quadruple.

Source

pub fn resolve(self, schemas: &Schemas) -> Result<TypeIdent, InterpreterError>

Resolve the quadruple to an actual type identifier that is available in the schema.

///

Caution This may end up in a type with the schema not fully resolved. This can happen if you specified the wrong schema name, or schema location. If you didn’t provide a SchemaIdent at all, the type is resolved by it’s name, which is also not always successful, if the type is not defined in the root of the available schemas.

If you use this to get suitable identifiers to define types for the interpreter (see with_type), then you are fine, because the interpreter will resolve unknown schema IDs by it’s own.

If you want to use the resolved identifier for selecting a MetaType from the resulting MetaTypes structure created by the interpreted, you have to resolve the type additionally using the IdentCache, which is also returned by the Interpreter (see exec_interpreter_with_ident_cache).

§Errors

Returns an error if the namespace or the namespace prefix could not be resolved.

Trait Implementations§

Source§

impl Clone for IdentQuadruple

Source§

fn clone(&self) -> IdentQuadruple

Returns a duplicate 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 IdentQuadruple

Source§

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

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

impl<N, S, X> From<(IdentType, N, Option<S>, X)> for IdentQuadruple

Source§

fn from((type_, ns, schema, name): (IdentType, N, Option<S>, X)) -> Self

Converts to this type from the input type.
Source§

impl<N, S, X> From<(IdentType, N, S, X)> for IdentQuadruple

Source§

fn from((type_, ns, schema, name): (IdentType, N, S, X)) -> Self

Converts to this type from the input type.
Source§

impl<N, X> From<(IdentType, N, X)> for IdentQuadruple
where N: Into<NamespaceIdent>, X: Into<String>,

Source§

fn from((type_, ns, name): (IdentType, N, X)) -> Self

Converts to this type from the input type.
Source§

impl<N, S, X> From<(IdentType, Option<N>, Option<S>, X)> for IdentQuadruple

Source§

fn from((type_, ns, schema, name): (IdentType, Option<N>, Option<S>, X)) -> Self

Converts to this type from the input type.
Source§

impl<N, S, X> From<(IdentType, Option<N>, S, X)> for IdentQuadruple

Source§

fn from((type_, ns, schema, name): (IdentType, Option<N>, S, X)) -> Self

Converts to this type from the input type.
Source§

impl<N, X> From<(IdentType, Option<N>, X)> for IdentQuadruple
where N: Into<NamespaceIdent>, X: Into<String>,

Source§

fn from((type_, ns, name): (IdentType, Option<N>, X)) -> Self

Converts to this type from the input type.
Source§

impl<X> From<(IdentType, X)> for IdentQuadruple
where X: AsRef<str>,

Source§

fn from((type_, ident): (IdentType, X)) -> Self

Converts to this type from the input type.

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<X> AsAny for X
where X: 'static,

Source§

fn into_any(self: Box<X>) -> Box<dyn Any>

Convert the boxed object into a boxed any.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Get a reference to the current object as Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Get a mutable reference to the current object as Any.
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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