Struct nxml_rs::ElementRef
source · pub struct ElementRef<'s> {
pub name: &'s str,
pub attributes: IndexMap<&'s str, &'s str>,
pub children: Vec<ElementRef<'s>>,
pub text_content: Cow<'s, str>,
}
Expand description
An XML element.
This is a borrowed version of Element, a result of zero-copy parsing. It is useful for reading Noita XML, but if you need to modify the element, you’d want to convert it to Element using into_owned.
Fields§
§name: &'s str
§attributes: IndexMap<&'s str, &'s str>
§children: Vec<ElementRef<'s>>
§text_content: Cow<'s, str>
Implementations§
source§impl<'s> ElementRef<'s>
impl<'s> ElementRef<'s>
source§impl ElementRef<'_>
impl ElementRef<'_>
pub fn parse(s: &str) -> Result<ElementRef<'_>, NxmlError<'_>>
pub fn parse_lenient(s: &str) -> (ElementRef<'_>, Vec<NxmlError<'_>>)
Trait Implementations§
source§impl<'s> Clone for ElementRef<'s>
impl<'s> Clone for ElementRef<'s>
source§fn clone(&self) -> ElementRef<'s>
fn clone(&self) -> ElementRef<'s>
Returns a copy 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<'s> Debug for ElementRef<'s>
impl<'s> Debug for ElementRef<'s>
source§impl Display for ElementRef<'_>
impl Display for ElementRef<'_>
source§impl<'s> PartialEq for ElementRef<'s>
impl<'s> PartialEq for ElementRef<'s>
source§fn eq(&self, other: &ElementRef<'s>) -> bool
fn eq(&self, other: &ElementRef<'s>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'s> Eq for ElementRef<'s>
impl<'s> StructuralPartialEq for ElementRef<'s>
Auto Trait Implementations§
impl<'s> Freeze for ElementRef<'s>
impl<'s> RefUnwindSafe for ElementRef<'s>
impl<'s> Send for ElementRef<'s>
impl<'s> Sync for ElementRef<'s>
impl<'s> Unpin for ElementRef<'s>
impl<'s> UnwindSafe for ElementRef<'s>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.