SaxElement

Enum SaxElement 

Source
pub enum SaxElement<'a> {
    StartTag(&'a str),
    Attribute(&'a str, &'a str),
    StartTagContent,
    StartTagEmpty,
    EndTag(&'a str),
    CData(&'a str),
}
Expand description

An XML element returned from the parser.

Variants§

§

StartTag(&'a str)

A start tag or empty element tag.

The argument is the full name of the tag. This element is sent to the handler as soon as the name is parsed.

This is always followed by zero or more Attribute elements, and then either a StartTagContent or StartTagEmpty element.

§

Attribute(&'a str, &'a str)

A tag attribute for the last StartTag.

First argument is the attribute name and the second argument is the attribute value. All references in the attribute value are replaced with the actual characters. Each attribute is sent as a separate element for efficiency.

§

StartTagContent

Indicates that the last StartTag was not an empty element tag.

Note that you might still get an EndTag immediately after this, as <tag/> and <tag></tag> are distinct in the XML specification, and not normalized.

§

StartTagEmpty

Indicates that the last StartTag was an empty element tag and will have no content.

§

EndTag(&'a str)

An end tag element.

The argument is the full name of the end tag.

§

CData(&'a str)

A character data element.

The argument is the text content. Note that you might get this element several times with different parts of the content for a single continous block of text. When you parse the document in multiple parse calls, or when the parser encounters a reference to substitute, collected content is flushed. The DocumentParser of iksemel automatically concatenates these parts to build a seamless document model.

Trait Implementations§

Source§

impl<'a> Debug for SaxElement<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for SaxElement<'a>

Source§

fn eq(&self, other: &SaxElement<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for SaxElement<'a>

Source§

impl<'a> StructuralPartialEq for SaxElement<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for SaxElement<'a>

§

impl<'a> RefUnwindSafe for SaxElement<'a>

§

impl<'a> Send for SaxElement<'a>

§

impl<'a> Sync for SaxElement<'a>

§

impl<'a> Unpin for SaxElement<'a>

§

impl<'a> UnwindSafe for SaxElement<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.