Skip to main content

DocumentComponentIndex

Struct DocumentComponentIndex 

Source
pub struct DocumentComponentIndex { /* private fields */ }
Expand description

Per-document index of top-level components declared by a single schema document.

Populated during assembly (register_* calls) and used for document-scoped lookup in apply_redefine() and apply_override().

Implementations§

Source§

impl DocumentComponentIndex

Source

pub fn new() -> Self

Source

pub fn insert(&mut self, identity: ComponentIdentity, key: ComponentKey)

Insert a component into the index.

Source

pub fn lookup_type( &self, namespace: Option<NameId>, name: NameId, ) -> Option<TypeKey>

Look up a type by namespace and local name (both simple and complex).

Source

pub fn lookup_simple_type( &self, namespace: Option<NameId>, name: NameId, ) -> Option<SimpleTypeKey>

Look up a simple type by namespace and local name.

Source

pub fn lookup_complex_type( &self, namespace: Option<NameId>, name: NameId, ) -> Option<ComplexTypeKey>

Look up a complex type by namespace and local name.

Source

pub fn lookup_element( &self, namespace: Option<NameId>, name: NameId, ) -> Option<ElementKey>

Look up an element by namespace and local name.

Source

pub fn lookup_attribute( &self, namespace: Option<NameId>, name: NameId, ) -> Option<AttributeKey>

Look up an attribute by namespace and local name.

Source

pub fn lookup_model_group( &self, namespace: Option<NameId>, name: NameId, ) -> Option<ModelGroupKey>

Look up a model group by namespace and local name.

Source

pub fn lookup_attribute_group( &self, namespace: Option<NameId>, name: NameId, ) -> Option<AttributeGroupKey>

Look up an attribute group by namespace and local name.

Source

pub fn lookup_notation( &self, namespace: Option<NameId>, name: NameId, ) -> Option<NotationKey>

Look up a notation by namespace and local name.

Source

pub fn is_empty(&self) -> bool

Returns true if the index is empty.

Source

pub fn len(&self) -> usize

Returns the number of components in the index.

Source

pub fn iter(&self) -> impl Iterator<Item = (&ComponentIdentity, &ComponentKey)>

Iterate over all (identity, key) pairs in the index.

Trait Implementations§

Source§

impl Debug for DocumentComponentIndex

Source§

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

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

impl Default for DocumentComponentIndex

Source§

fn default() -> DocumentComponentIndex

Returns the “default value” for a type. 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> 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.