Skip to main content

ReferenceResolver

Struct ReferenceResolver 

Source
pub struct ReferenceResolver<'a> { /* private fields */ }
Expand description

Reference resolver for QName → component ID resolution

This struct holds a reference to the schema set and provides methods to resolve different types of QName references.

Implementations§

Source§

impl<'a> ReferenceResolver<'a>

Source

pub fn new(schema_set: &'a SchemaSet) -> Self

Create a new reference resolver for the given schema set

Source

pub fn resolve_type_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<TypeKey>

Resolve a type reference (QName → TypeKey)

Checks built-in types first, then user-defined types. The namespace should already be resolved during parsing via NamespaceContextSnapshot.

Source

pub fn try_resolve_type_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<Option<TypeKey>>

Lookup-only variant of [resolve_type_ref]: returns Ok(None) when the QName resolves to no component, while still propagating namespace-visibility errors as Err. Used by callers that want to defer a missing-component miss instead of failing compilation.

Source

pub fn try_resolve_element_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<Option<ElementKey>>

Lookup-only variant of [resolve_element_ref]: returns Ok(None) for the “not found” case, while still propagating visibility errors.

Source

pub fn resolve_type_ref_result( &self, type_ref: &TypeRefResult, source: Option<&SourceRef>, ) -> SchemaResult<Option<TypeKey>>

Resolve a TypeRefResult to a TypeKey

Handles both QName references and inline types. For inline types, the type must already be allocated in the arena.

Source

pub fn resolve_element_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<ElementKey>

Resolve an element reference (QName → ElementKey)

Source

pub fn resolve_attribute_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<AttributeKey>

Resolve an attribute reference (QName → AttributeKey)

Source

pub fn resolve_group_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<ModelGroupKey>

Resolve a model group reference (QName → ModelGroupKey)

Source

pub fn resolve_attribute_group_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<AttributeGroupKey>

Resolve an attribute group reference (QName → AttributeGroupKey)

Source

pub fn resolve_notation_ref( &self, qname: &QNameRef, source: Option<&SourceRef>, ) -> SchemaResult<NotationKey>

Resolve a notation reference (QName → NotationKey)

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ReferenceResolver<'a>

§

impl<'a> !Send for ReferenceResolver<'a>

§

impl<'a> !Sync for ReferenceResolver<'a>

§

impl<'a> !UnwindSafe for ReferenceResolver<'a>

§

impl<'a> Freeze for ReferenceResolver<'a>

§

impl<'a> Unpin for ReferenceResolver<'a>

§

impl<'a> UnsafeUnpin for ReferenceResolver<'a>

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