pub struct NamespaceRegistry { /* private fields */ }
Expand description
DDEX namespace registry for comprehensive namespace management
Implementations§
Source§impl NamespaceRegistry
impl NamespaceRegistry
Sourcepub fn register_namespace(&mut self, info: NamespaceInfo)
pub fn register_namespace(&mut self, info: NamespaceInfo)
Register a new namespace
Sourcepub fn register_custom_namespace(
&mut self,
info: NamespaceInfo,
) -> Result<(), NamespaceError>
pub fn register_custom_namespace( &mut self, info: NamespaceInfo, ) -> Result<(), NamespaceError>
Register a custom namespace
Sourcepub fn detect_version(&self, namespace_uri: &str) -> Option<ERNVersion>
pub fn detect_version(&self, namespace_uri: &str) -> Option<ERNVersion>
Detect DDEX version from namespace URI
Sourcepub fn get_version_namespaces(&self, version: &ERNVersion) -> Vec<String>
pub fn get_version_namespaces(&self, version: &ERNVersion) -> Vec<String>
Get all namespace URIs for a specific ERN version
Sourcepub fn get_preferred_prefix(&self, uri: &str) -> Option<&str>
pub fn get_preferred_prefix(&self, uri: &str) -> Option<&str>
Get preferred prefix for a namespace URI
Sourcepub fn get_namespace_info(&self, uri: &str) -> Option<&NamespaceInfo>
pub fn get_namespace_info(&self, uri: &str) -> Option<&NamespaceInfo>
Get namespace info by URI
Sourcepub fn is_prefix_reserved(&self, prefix: &str) -> bool
pub fn is_prefix_reserved(&self, prefix: &str) -> bool
Check if a prefix is reserved
Sourcepub fn generate_unique_prefix(&self, base_prefix: &str) -> String
pub fn generate_unique_prefix(&self, base_prefix: &str) -> String
Generate a unique prefix for a namespace
Sourcepub fn resolve_prefix_conflict(
&self,
_uri: &str,
existing_prefix: &str,
new_prefix: &str,
strategy: ConflictResolution,
) -> Result<String, NamespaceError>
pub fn resolve_prefix_conflict( &self, _uri: &str, existing_prefix: &str, new_prefix: &str, strategy: ConflictResolution, ) -> Result<String, NamespaceError>
Resolve namespace conflicts using the specified strategy
Sourcepub fn create_minimal_declarations(
&self,
used_namespaces: &[String],
) -> IndexMap<String, String>
pub fn create_minimal_declarations( &self, used_namespaces: &[String], ) -> IndexMap<String, String>
Create minimal namespace declarations for root element
Sourcepub fn validate_declarations(
&self,
declarations: &IndexMap<String, String>,
) -> Vec<NamespaceWarning>
pub fn validate_declarations( &self, declarations: &IndexMap<String, String>, ) -> Vec<NamespaceWarning>
Validate namespace declarations against known namespaces
Sourcepub fn get_namespaces_by_standard(
&self,
standard: &DDEXStandard,
) -> Vec<&NamespaceInfo>
pub fn get_namespaces_by_standard( &self, standard: &DDEXStandard, ) -> Vec<&NamespaceInfo>
Get all registered namespaces for a standard
Trait Implementations§
Source§impl Clone for NamespaceRegistry
impl Clone for NamespaceRegistry
Source§fn clone(&self) -> NamespaceRegistry
fn clone(&self) -> NamespaceRegistry
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 moreSource§impl Debug for NamespaceRegistry
impl Debug for NamespaceRegistry
Auto Trait Implementations§
impl Freeze for NamespaceRegistry
impl RefUnwindSafe for NamespaceRegistry
impl Send for NamespaceRegistry
impl Sync for NamespaceRegistry
impl Unpin for NamespaceRegistry
impl UnwindSafe for NamespaceRegistry
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