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.
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.
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.
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DavXmlElement
impl Debug for DavXmlElement
Source§impl PartialEq for DavXmlElement
impl PartialEq for DavXmlElement
Source§fn eq(&self, other: &DavXmlElement) -> bool
fn eq(&self, other: &DavXmlElement) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.