[][src]Struct quick_xml::events::BytesText

pub struct BytesText<'a> { /* fields omitted */ }

Data from various events (most notably, Event::Text).

Methods

impl<'a> BytesText<'a>[src]

pub fn from_escaped<C: Into<Cow<'a, [u8]>>>(content: C) -> BytesText<'a>[src]

Creates a new BytesText from an escaped byte sequence.

pub fn from_plain(content: &'a [u8]) -> BytesText<'a>[src]

Creates a new BytesText from a byte sequence. The byte sequence is expected not to be escaped.

pub fn from_escaped_str<C: Into<Cow<'a, str>>>(content: C) -> BytesText<'a>[src]

Creates a new BytesText from an escaped string.

pub fn from_plain_str(content: &'a str) -> BytesText<'a>[src]

Creates a new BytesText from a string. The string is expected not to be escaped.

pub fn into_owned(self) -> BytesText<'static>[src]

Ensures that all data is owned to extend the object's lifetime if necessary.

pub fn unescaped(&self) -> Result<Cow<[u8]>>[src]

gets escaped content

Searches for '&' into content and try to escape the coded character if possible returns Malformed error with index within element if '&' is not followed by ';'

pub fn unescape_and_decode<B: BufRead>(
    &self,
    reader: &Reader<B>
) -> Result<String>
[src]

helper method to unescape then decode self using the reader encoding

for performance reasons (could avoid allocating a String), it might be wiser to manually use

  1. BytesText::unescaped()
  2. Reader::decode(...)

pub fn escaped(&self) -> &[u8][src]

Gets escaped content.

Trait Implementations

impl<'a> Clone for BytesText<'a>[src]

impl<'a> Debug for BytesText<'a>[src]

impl<'a> Deref for BytesText<'a>[src]

type Target = [u8]

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a> RefUnwindSafe for BytesText<'a>

impl<'a> Send for BytesText<'a>

impl<'a> Sync for BytesText<'a>

impl<'a> Unpin for BytesText<'a>

impl<'a> UnwindSafe for BytesText<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.