Enum magnesium::XmlElement [−][src]
An element within an XML structure.
Variants
An opening tag with a name and some attributes.
Eg: <books attr1="val1">
If the XML is well formed, then there will be an EndTag with a matching name later on. In between there can be any number of sub-entries.
Fields of StartTag
name: &'s str
Name of this tag.
attrs: &'s str
Attribute string, parse this with a
TagAttributeIterator
.
Closes the StartTag
of the same name.
Eg: </books>
An "empty" tag has no inner content, just attributes.
Eg: <enum name="GRAPHICS_POLYGON value="0x0001"/>
Fields of EmptyTag
name: &'s str
The tag's name.
attrs: &'s str
The tag's attribute string.
Parse this with a
TagAttributeIterator
.
Text between tags.
If there's a "CDATA" entry it is parsed as a Text element.
Text between <!--
and -->
.
Implementations
impl<'s> XmlElement<'s>
[src]
pub fn unwrap_start_tag(&self) -> (&'s str, &'s str)
[src]
Unwraps a StartTag
variant into the inner (name, attrs)
pair.
Panics
If the variant isn't StartTag
this will panic.
pub fn unwrap_end_tag(&self) -> &'s str
[src]
pub fn unwrap_text(&self) -> &'s str
[src]
pub fn unwrap_comment(&self) -> &'s str
[src]
Unwraps a Comment
variant into the inner &str
value.
Panics
If the variant isn't Comment
this will panic.
Trait Implementations
impl<'s> Clone for XmlElement<'s>
[src]
fn clone(&self) -> XmlElement<'s>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'s> Copy for XmlElement<'s>
[src]
impl<'s> Debug for XmlElement<'s>
[src]
impl<'s> Eq for XmlElement<'s>
[src]
impl<'s> Hash for XmlElement<'s>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'s> PartialEq<XmlElement<'s>> for XmlElement<'s>
[src]
fn eq(&self, other: &XmlElement<'s>) -> bool
[src]
fn ne(&self, other: &XmlElement<'s>) -> bool
[src]
impl<'s> StructuralEq for XmlElement<'s>
[src]
impl<'s> StructuralPartialEq for XmlElement<'s>
[src]
Auto Trait Implementations
impl<'s> Send for XmlElement<'s>
[src]
impl<'s> Sync for XmlElement<'s>
[src]
impl<'s> Unpin for XmlElement<'s>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,