pub struct DavXmlElement {
pub name: String,
pub prefix: Option<String>,
pub namespace: Option<String>,
pub namespaces: BTreeMap<String, String>,
pub attributes: BTreeMap<String, String>,
pub children: Vec<DavXmlNode>,
}Expand description
Owned DAV element used for persisted subtrees and response composition.
Known request grammars traverse the source-backed aster_forge_xml arena directly and only
materialize the owner or property subtrees that must cross the backend boundary.
Fields§
§name: StringLocal element name.
prefix: Option<String>Lexical prefix, when present.
namespace: Option<String>Resolved namespace URI, when present.
namespaces: BTreeMap<String, String>In-scope namespace declarations keyed by prefix; an empty key is the default namespace.
attributes: BTreeMap<String, String>Element attributes in their lexical form.
children: Vec<DavXmlNode>Ordered child content.
Implementations§
Source§impl DavXmlElement
impl DavXmlElement
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, DavXmlError>
pub fn parse(bytes: &[u8]) -> Result<Self, DavXmlError>
Parses one bounded XML element.
§Errors
Returns DavXmlError when the bounded XML element is unsafe, malformed, or invalid.
Sourcepub fn parse_reader(reader: impl Read) -> Result<Self, DavXmlError>
pub fn parse_reader(reader: impl Read) -> Result<Self, DavXmlError>
Parses one bounded XML element from a reader.
§Errors
Returns DavXmlError when reader input is unsafe, malformed, or invalid XML.
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, DavXmlError>
pub fn to_bytes(&self) -> Result<Vec<u8>, DavXmlError>
Serializes the element as UTF-8 XML bytes.
§Errors
Returns DavXmlError when the element cannot be serialized as valid XML.
Sourcepub fn child_elements(&self) -> impl Iterator<Item = &Self>
pub fn child_elements(&self) -> impl Iterator<Item = &Self>
Iterates over direct child elements while ignoring text, comments, and CDATA.
Trait Implementations§
Source§impl Clone for DavXmlElement
impl Clone for DavXmlElement
Source§fn clone(&self) -> DavXmlElement
fn clone(&self) -> DavXmlElement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DavXmlElement
impl Debug for DavXmlElement
Source§impl PartialEq for DavXmlElement
impl PartialEq for DavXmlElement
impl Eq for DavXmlElement
impl StructuralPartialEq for DavXmlElement
Auto Trait Implementations§
impl Freeze for DavXmlElement
impl RefUnwindSafe for DavXmlElement
impl Send for DavXmlElement
impl Sync for DavXmlElement
impl Unpin for DavXmlElement
impl UnwindSafe for DavXmlElement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.