pub struct Schemas { /* private fields */ }
Expand description
Represents the XML schema information load from different sources.
This structure is usually created by the Parser
.
It is the used by the Interpreter
to
generate the more common Types
structure out of it.
Implementations§
Source§impl Schemas
impl Schemas
Sourcepub fn add_schema(
&mut self,
prefix: Option<NamespacePrefix>,
namespace: Namespace,
schema: Schema,
)
pub fn add_schema( &mut self, prefix: Option<NamespacePrefix>, namespace: Namespace, schema: Schema, )
Add a new schema to the schemas structure.
§Errors
Will just forward the errors from get_or_create_namespace_info_mut
.
Sourcepub fn get_or_create_namespace_info_mut(
&mut self,
prefix: Option<NamespacePrefix>,
namespace: Namespace,
) -> &mut NamespaceInfo
pub fn get_or_create_namespace_info_mut( &mut self, prefix: Option<NamespacePrefix>, namespace: Namespace, ) -> &mut NamespaceInfo
Get a mutable reference to a NamespaceInfo
or create a new one if needed.
Sourcepub fn schemas(&self) -> Iter<'_, SchemaId, Schema>
pub fn schemas(&self) -> Iter<'_, SchemaId, Schema>
Returns an iterator over all schemas stored in this structure.
Sourcepub fn namespaces(&self) -> Iter<'_, NamespaceId, NamespaceInfo>
pub fn namespaces(&self) -> Iter<'_, NamespaceId, NamespaceInfo>
Returns an iterator over all namespace information instances stored in this structure.
Sourcepub fn get_schema(&self, id: &SchemaId) -> Option<&Schema>
pub fn get_schema(&self, id: &SchemaId) -> Option<&Schema>
Returns a reference to a specific schema by using the schema id,
or None
if the schema is not known.
Sourcepub fn get_namespace_info(&self, id: &NamespaceId) -> Option<&NamespaceInfo>
pub fn get_namespace_info(&self, id: &NamespaceId) -> Option<&NamespaceInfo>
Returns a reference to a specific namespace information instance by using
the namespace id, or None
if the schema is not known.
Sourcepub fn get_namespace_info_by_namespace(
&self,
ns: &Namespace,
) -> Option<&NamespaceInfo>
pub fn get_namespace_info_by_namespace( &self, ns: &Namespace, ) -> Option<&NamespaceInfo>
Returns a reference to a specific namespace information instance by using
the namespace URI, or None
if the schema is not known.
Sourcepub fn resolve_prefix(&self, prefix: &NamespacePrefix) -> Option<NamespaceId>
pub fn resolve_prefix(&self, prefix: &NamespacePrefix) -> Option<NamespaceId>
Try to resolve the namespace prefix to a namespace id.
Returns the namespace id of the given namespace prefix
, or None
.
Sourcepub fn resolve_namespace(&self, ns: &Namespace) -> Option<NamespaceId>
pub fn resolve_namespace(&self, ns: &Namespace) -> Option<NamespaceId>
Try to resolve the namespace to a namespace id.
Returns the namespace id of the given namespace ns
, or None
.