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

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

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

Implementations

Creates a new BytesText from an escaped byte sequence.

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

Creates a new BytesText from an escaped string.

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

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

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 ‘;’

See also unescaped_with_custom_entities()

gets escaped content with custom entities

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 ‘;’ Additional entities can be provided in custom_entities.

Pre-condition

The keys and values of custom_entities, if any, must be valid UTF-8.

See also unescaped()

helper method to unescape then decode self using the reader encoding but without BOM (Byte order mark)

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

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

helper method to unescape then decode self using the reader encoding with custom entities but without BOM (Byte order mark)

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

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

Pre-condition

The keys and values of custom_entities, if any, must be valid UTF-8.

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(…)

helper method to unescape then decode self using the reader encoding with custom entities

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

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

Pre-condition

The keys and values of custom_entities, if any, must be valid UTF-8.

Gets escaped content.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.