Skip to main content

XmlPullEvent

Enum XmlPullEvent 

Source
pub enum XmlPullEvent<'a> {
    Declaration {
        version: &'a str,
        encoding: Option<&'a str>,
        standalone: Option<bool>,
    },
    DocType {
        name: &'a str,
        public_id: Option<&'a str>,
        system_id: Option<&'a str>,
    },
    StartElement {
        name: &'a str,
        attr_raw: &'a str,
    },
    EndElement {
        name: &'a str,
    },
    Text(&'a str),
    Comment(&'a str),
    CData(&'a str),
    ProcessingInstruction {
        target: &'a str,
        data: &'a str,
    },
    EndDocument,
}
Expand description

Zero-allocation streaming event variant emitted by XmlPullParser.

Variants§

§

Declaration

XML Declaration (e.g. <?xml version="1.0" encoding="UTF-8"?>).

Fields

§version: &'a str

Version string slice.

§encoding: Option<&'a str>

Optional encoding string slice.

§standalone: Option<bool>

Optional standalone flag.

§

DocType

DOCTYPE definition (e.g. <!DOCTYPE html SYSTEM "...">).

Fields

§name: &'a str

Document type root name.

§public_id: Option<&'a str>

Optional PUBLIC identifier.

§system_id: Option<&'a str>

Optional SYSTEM identifier.

§

StartElement

Opening element tag (e.g. <book category="web">).

Fields

§name: &'a str

Element tag name.

§attr_raw: &'a str

Raw attribute text slice within element tag.

§

EndElement

Closing element tag (e.g. </book>).

Fields

§name: &'a str

Element tag name.

§

Text(&'a str)

Text node content slice.

§

Comment(&'a str)

Comment content slice.

§

CData(&'a str)

CDATA section content slice.

§

ProcessingInstruction

Processing instruction (<?target data?>).

Fields

§target: &'a str

PI target name.

§data: &'a str

PI data payload.

§

EndDocument

End of XML document stream.

Implementations§

Source§

impl<'a> XmlPullEvent<'a>

Source

pub fn attributes(&self) -> XmlPullAttributesIter<'a> ⓘ

Returns an iterator over tag attributes parsed on demand with zero allocations.

Trait Implementations§

Source§

impl<'a> Clone for XmlPullEvent<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for XmlPullEvent<'a>

Source§

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

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

impl<'a> Eq for XmlPullEvent<'a>

Source§

impl<'a> PartialEq for XmlPullEvent<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for XmlPullEvent<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for XmlPullEvent<'a>

§

impl<'a> RefUnwindSafe for XmlPullEvent<'a>

§

impl<'a> Send for XmlPullEvent<'a>

§

impl<'a> Sync for XmlPullEvent<'a>

§

impl<'a> Unpin for XmlPullEvent<'a>

§

impl<'a> UnsafeUnpin for XmlPullEvent<'a>

§

impl<'a> UnwindSafe for XmlPullEvent<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.