[]Struct xml5ever::tendril::stream::Utf8LossyDecoder

pub struct Utf8LossyDecoder<Sink, A = NonAtomic> where
    A: Atomicity,
    Sink: TendrilSink<UTF8, A>, 
{ pub inner_sink: Sink, // some fields omitted }

A TendrilSink adaptor that takes bytes, decodes them as UTF-8, lossily replace ill-formed byte sequences with U+FFFD replacement characters, and emits Unicode (StrTendril).

This does not allocate memory: the output is either subtendrils on the input, on inline tendrils for a single code point.

Fields

inner_sink: Sink

Methods

impl<Sink, A> Utf8LossyDecoder<Sink, A> where
    A: Atomicity,
    Sink: TendrilSink<UTF8, A>, 

pub fn new(inner_sink: Sink) -> Utf8LossyDecoder<Sink, A>

Create a new incremental UTF-8 decoder.

Trait Implementations

impl<Sink, A> TendrilSink<Bytes, A> for Utf8LossyDecoder<Sink, A> where
    A: Atomicity,
    Sink: TendrilSink<UTF8, A>, 

type Output = <Sink as TendrilSink<UTF8, A>>::Output

What the overall result of processing is.

fn one<T>(self, t: T) -> Self::Output where
    T: Into<Tendril<F, A>>, 

Process one tendril and finish.

fn from_iter<I>(self, i: I) -> Self::Output where
    I: IntoIterator,
    <I as IntoIterator>::Item: Into<Tendril<F, A>>, 

Consume an iterator of tendrils, processing each item, then finish.

fn read_from<R>(self, r: &mut R) -> Result<Self::Output, Error> where
    F: SliceFormat<Slice = [u8]>,
    R: Read

Read from the given stream of bytes until exhaustion and process incrementally, then finish. Return Err at the first I/O error. Read more

fn from_file<P>(self, path: P) -> Result<Self::Output, Error> where
    F: SliceFormat<Slice = [u8]>,
    P: AsRef<Path>, 

Read from the file at the given path and process incrementally, then finish. Return Err at the first I/O error. Read more

Auto Trait Implementations

impl<Sink, A> Send for Utf8LossyDecoder<Sink, A> where
    A: Send,
    Sink: Send

impl<Sink, A> Sync for Utf8LossyDecoder<Sink, A> where
    A: Sync,
    Sink: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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