pub struct NamespaceContext {
pub current_scope: NamespaceScope,
pub document_namespaces: IndexMap<String, String>,
pub default_namespace: Option<String>,
pub ern_version: Option<ERNVersion>,
}
Expand description
Namespace context for maintaining state during parsing
Fields§
§current_scope: NamespaceScope
Current namespace scope
document_namespaces: IndexMap<String, String>
Detected namespaces at document level
default_namespace: Option<String>
Current default namespace
ern_version: Option<ERNVersion>
Detected ERN version
Implementations§
Source§impl NamespaceContext
impl NamespaceContext
Sourcepub fn from_detection_result(result: NamespaceDetectionResult) -> Self
pub fn from_detection_result(result: NamespaceDetectionResult) -> Self
Create new namespace context from detection result
Sourcepub fn create_child(&self) -> Self
pub fn create_child(&self) -> Self
Create a new child context for nested elements
Sourcepub fn declare_namespace(&mut self, prefix: String, uri: String)
pub fn declare_namespace(&mut self, prefix: String, uri: String)
Declare a namespace in current scope
Sourcepub fn resolve_element_name(
&self,
local_name: &str,
prefix: Option<&str>,
) -> ResolvedName
pub fn resolve_element_name( &self, local_name: &str, prefix: Option<&str>, ) -> ResolvedName
Resolve element name with namespace
Trait Implementations§
Source§impl Clone for NamespaceContext
impl Clone for NamespaceContext
Source§fn clone(&self) -> NamespaceContext
fn clone(&self) -> NamespaceContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for NamespaceContext
impl RefUnwindSafe for NamespaceContext
impl Send for NamespaceContext
impl Sync for NamespaceContext
impl Unpin for NamespaceContext
impl UnwindSafe for NamespaceContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more