Skip to main content

BytesEvent

Enum BytesEvent 

Source
pub enum BytesEvent<'r, 'src> {
    StartElement(BytesStartTag<'r, 'src>),
    EndElement(BytesEndTag<'src>),
    Text(BytesText<'src>),
    CData(BytesCData<'src>),
    Comment(BytesComment<'src>),
    Pi(BytesPi<'src>),
    EntityRef(BytesEntityRef<'src>),
    Eof,
}
Expand description

A streaming XML event with lazy access to its payload.

Returned by XmlBytesReader::next. Each variant wraps a tag struct whose methods (name(), attrs(), etc.) extract data on demand — discard the event without calling a method and you pay almost nothing. For an eager API that fills a caller-owned buffer see XmlBytesReader::next_into which returns BytesEventInto.

Variants§

§

StartElement(BytesStartTag<'r, 'src>)

An opening (or empty-element) start tag.

§

EndElement(BytesEndTag<'src>)

A closing tag. Emitted once for each StartElement, including for empty elements (<br/> emits StartElement then EndElement).

§

Text(BytesText<'src>)

Character data between tags.

§

CData(BytesCData<'src>)

A <![CDATA[…]]> section.

§

Comment(BytesComment<'src>)

An XML comment.

§

Pi(BytesPi<'src>)

A processing instruction.

§

EntityRef(BytesEntityRef<'src>)

An unresolved entity reference — &foo; left literal in the event stream. Emitted only when ParseOptions::resolve_entities is false and the reference is a user-declared entity (predefined &amp; etc. and numeric &#NN; refs are always expanded into Text payloads). Carries the entity name (without the leading & / trailing ;).

§

Eof

The document has been fully consumed.

Trait Implementations§

Source§

impl<'r, 'src> Debug for BytesEvent<'r, 'src>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'r, 'src> !RefUnwindSafe for BytesEvent<'r, 'src>

§

impl<'r, 'src> !UnwindSafe for BytesEvent<'r, 'src>

§

impl<'r, 'src> Freeze for BytesEvent<'r, 'src>

§

impl<'r, 'src> Send for BytesEvent<'r, 'src>

§

impl<'r, 'src> Sync for BytesEvent<'r, 'src>

§

impl<'r, 'src> Unpin for BytesEvent<'r, 'src>

§

impl<'r, 'src> UnsafeUnpin for BytesEvent<'r, 'src>

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> Same for T

Source§

type Output = T

Should always be Self
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.