Struct borealis::tendril::stream::LossyDecoder []

pub struct LossyDecoder<Sink, A = NonAtomic> where
    A: Atomicity,
    Sink: TendrilSink<UTF8, A>, 
{ /* fields omitted */ }

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

This allocates new tendrils for encodings other than UTF-8.

Methods

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

Create a new incremental decoder.

Create a new incremental decoder for the UTF-8 encoding.

This is useful for content that is known at run-time to be UTF-8 (whereas Utf8LossyDecoder requires knowning at compile-time.)

Give a reference to the inner sink.

Give a mutable reference to the inner sink.

Trait Implementations

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

Process this tendril.

Indicates that an error has occurred.

What the overall result of processing is.

Indicates the end of the stream.

Process one tendril and finish.

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

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

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