pub struct Packet<'a> { /* private fields */ }Expand description
Bounded parsed XMP packet, borrowing its source XML.
Implementations§
Source§impl<'a> Packet<'a>
impl<'a> Packet<'a>
Sourcepub fn parse(xml: &'a str) -> Result<Self, Error>
pub fn parse(xml: &'a str) -> Result<Self, Error>
Parse at most 16 MiB / 65,536 XML nodes / 64 nested elements. Unknown XML is inspectable, but selected property access is strict.
Sourcepub fn property(
&self,
namespace: &str,
name: &str,
) -> Result<Option<Vec<String>>, Error>
pub fn property( &self, namespace: &str, name: &str, ) -> Result<Option<Vec<String>>, Error>
Read a property of the document’s empty-subject RDF Description. Accepts a scalar attribute/element or an rdf:Seq array of plain values. Duplicate declarations, alternate subjects, qualifiers and mixed content refuse instead of selecting a possibly different rendering interpretation.
Sourcepub fn resource_sequence(
&self,
namespace: &str,
name: &str,
item_namespace: &str,
item_name: &str,
) -> Result<Vec<Vec<Property>>, Error>
pub fn resource_sequence( &self, namespace: &str, name: &str, item_namespace: &str, item_name: &str, ) -> Result<Vec<Vec<Property>>, Error>
Read a sequence of resource structures (e.g. GContainer Directory). Each item contains namespace-qualified scalar properties. Unknown scalar fields are returned too; the caller chooses its schema, never its prefix.
Sourcepub fn fields(&self) -> Result<Vec<Field>, Error>
pub fn fields(&self) -> Result<Vec<Field>, Error>
Full XML structural snapshot: elements, attributes, text, comments and processing instructions. Namespace declarations are represented by resolved names, not prefix spelling. No unknown application property is discarded. This is structural comparison, not equivalence of arbitrary RDF graphs.