pub struct Extensions {
pub fragments: IndexMap<String, XmlFragment>,
pub global_namespaces: IndexMap<String, String>,
pub document_processing_instructions: Vec<ProcessingInstruction>,
pub document_comments: Vec<Comment>,
pub legacy_data: HashMap<String, Value>,
}
Expand description
Extension container with location-aware storage
Fields§
§fragments: IndexMap<String, XmlFragment>
Extensions organized by their location in the DDEX structure
global_namespaces: IndexMap<String, String>
Global namespace declarations that should be preserved at document level
document_processing_instructions: Vec<ProcessingInstruction>
Document-level processing instructions
document_comments: Vec<Comment>
Document-level comments
legacy_data: HashMap<String, Value>
Legacy simple extensions (for backward compatibility)
Implementations§
Source§impl Extensions
impl Extensions
Sourcepub fn add_fragment(&mut self, location: String, fragment: XmlFragment)
pub fn add_fragment(&mut self, location: String, fragment: XmlFragment)
Add an XML fragment at a specific location
Sourcepub fn get_fragment(&self, location: &str) -> Option<&XmlFragment>
pub fn get_fragment(&self, location: &str) -> Option<&XmlFragment>
Get a fragment by location
Sourcepub fn get_fragments_matching(
&self,
pattern: &str,
) -> Vec<(&String, &XmlFragment)>
pub fn get_fragments_matching( &self, pattern: &str, ) -> Vec<(&String, &XmlFragment)>
Get all fragments for a location pattern
Sourcepub fn add_global_namespace(&mut self, prefix: String, uri: String)
pub fn add_global_namespace(&mut self, prefix: String, uri: String)
Add a global namespace declaration
Sourcepub fn add_document_processing_instruction(&mut self, pi: ProcessingInstruction)
pub fn add_document_processing_instruction(&mut self, pi: ProcessingInstruction)
Add a document-level processing instruction
Sourcepub fn add_document_comment(&mut self, comment: String)
pub fn add_document_comment(&mut self, comment: String)
Add a document-level comment
Sourcepub fn add_document_comment_structured(&mut self, comment: Comment)
pub fn add_document_comment_structured(&mut self, comment: Comment)
Add a structured document-level comment
Sourcepub fn merge(&mut self, other: Extensions)
pub fn merge(&mut self, other: Extensions)
Merge another Extensions instance into this one
Trait Implementations§
Source§impl Clone for Extensions
impl Clone for Extensions
Source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
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 Extensions
impl Debug for Extensions
Source§impl Default for Extensions
impl Default for Extensions
Source§fn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Extensions
impl<'de> Deserialize<'de> for Extensions
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 PartialEq for Extensions
impl PartialEq for Extensions
Source§impl Serialize for Extensions
impl Serialize for Extensions
impl StructuralPartialEq for Extensions
Auto Trait Implementations§
impl Freeze for Extensions
impl RefUnwindSafe for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl UnwindSafe for Extensions
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