pub struct AttributeMap { /* private fields */ }
Expand description
Comprehensive attribute map with deterministic ordering
Implementations§
Source§impl AttributeMap
impl AttributeMap
Sourcepub fn insert(
&mut self,
name: QName,
value: AttributeValue,
) -> Option<AttributeValue>
pub fn insert( &mut self, name: QName, value: AttributeValue, ) -> Option<AttributeValue>
Insert an attribute
Sourcepub fn insert_str(
&mut self,
name: &str,
value: impl Into<AttributeValue>,
) -> Option<AttributeValue>
pub fn insert_str( &mut self, name: &str, value: impl Into<AttributeValue>, ) -> Option<AttributeValue>
Insert an attribute by string name
Sourcepub fn get(&self, name: &QName) -> Option<&AttributeValue>
pub fn get(&self, name: &QName) -> Option<&AttributeValue>
Get an attribute value
Sourcepub fn get_str(&self, name: &str) -> Option<&AttributeValue>
pub fn get_str(&self, name: &str) -> Option<&AttributeValue>
Get an attribute value by string name
Sourcepub fn remove(&mut self, name: &QName) -> Option<AttributeValue>
pub fn remove(&mut self, name: &QName) -> Option<AttributeValue>
Remove an attribute
Sourcepub fn contains_key(&self, name: &QName) -> bool
pub fn contains_key(&self, name: &QName) -> bool
Check if an attribute exists
Sourcepub fn iter_canonical(&self) -> impl Iterator<Item = (&QName, &AttributeValue)>
pub fn iter_canonical(&self) -> impl Iterator<Item = (&QName, &AttributeValue)>
Get all attributes in canonical order
Sourcepub fn iter(&self) -> impl Iterator<Item = (&QName, &AttributeValue)>
pub fn iter(&self) -> impl Iterator<Item = (&QName, &AttributeValue)>
Get all attributes (in insertion order)
Sourcepub fn iter_mut(
&mut self,
) -> impl Iterator<Item = (&QName, &mut AttributeValue)>
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&QName, &mut AttributeValue)>
Get mutable iterator over all attributes
Sourcepub fn standard_attributes(&self) -> IndexMap<QName, AttributeValue>
pub fn standard_attributes(&self) -> IndexMap<QName, AttributeValue>
Get all DDEX standard attributes
Sourcepub fn extension_attributes(&self) -> IndexMap<QName, AttributeValue>
pub fn extension_attributes(&self) -> IndexMap<QName, AttributeValue>
Get all extension/custom attributes
Sourcepub fn namespace_declarations(&self) -> IndexMap<QName, AttributeValue>
pub fn namespace_declarations(&self) -> IndexMap<QName, AttributeValue>
Get all namespace declaration attributes
Sourcepub fn merge(&mut self, other: &AttributeMap, strategy: AttributeMergeStrategy)
pub fn merge(&mut self, other: &AttributeMap, strategy: AttributeMergeStrategy)
Merge attributes from another map, with conflict resolution
Sourcepub fn validate(&self) -> Vec<AttributeError>
pub fn validate(&self) -> Vec<AttributeError>
Validate all attributes
Sourcepub fn to_string_map(&self) -> IndexMap<String, String>
pub fn to_string_map(&self) -> IndexMap<String, String>
Convert to a simple string map for backwards compatibility
Sourcepub fn from_string_map(map: IndexMap<String, String>) -> Self
pub fn from_string_map(map: IndexMap<String, String>) -> Self
Create from a simple string map
Sourcepub fn keys(&self) -> Keys<'_, QName, AttributeValue>
pub fn keys(&self) -> Keys<'_, QName, AttributeValue>
Get iterator over attribute keys
Sourcepub fn to_canonical_ordered(&self) -> IndexMap<QName, AttributeValue>
pub fn to_canonical_ordered(&self) -> IndexMap<QName, AttributeValue>
Get all attributes in canonical order (namespace declarations first, then alphabetical)
Trait Implementations§
Source§impl Clone for AttributeMap
impl Clone for AttributeMap
Source§fn clone(&self) -> AttributeMap
fn clone(&self) -> AttributeMap
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 AttributeMap
impl Debug for AttributeMap
Source§impl Default for AttributeMap
impl Default for AttributeMap
Source§impl<'de> Deserialize<'de> for AttributeMap
impl<'de> Deserialize<'de> for AttributeMap
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> IntoIterator for &'a AttributeMap
impl<'a> IntoIterator for &'a AttributeMap
Source§impl PartialEq for AttributeMap
impl PartialEq for AttributeMap
Source§impl Serialize for AttributeMap
impl Serialize for AttributeMap
impl StructuralPartialEq for AttributeMap
Auto Trait Implementations§
impl Freeze for AttributeMap
impl RefUnwindSafe for AttributeMap
impl Send for AttributeMap
impl Sync for AttributeMap
impl Unpin for AttributeMap
impl UnwindSafe for AttributeMap
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