[][src]Struct marked::Decoder

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

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

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

Implementations

impl<Sink, A> Decoder<Sink, A> where
    Sink: TendrilSink<UTF8, A>,
    A: Atomicity
[src]

pub fn new(encoding: &'static Encoding, sink: Sink) -> Self[src]

pub fn inner_sink(&self) -> &Sink[src]

Return reference to the inner sink.

pub fn read_to_end<R>(self, r: &mut R) -> Result<Sink::Output, Error> where
    Self: Sized,
    R: Read
[src]

Read until EOF of stream, processing each buffer, and finish this decoder. Returns the sink output or any io::Error.

Trait Implementations

impl<Sink, A> TendrilSink<Bytes, A> for Decoder<Sink, A> where
    Sink: TendrilSink<UTF8, A>,
    A: Atomicity
[src]

type Output = Sink::Output

What the overall result of processing is.

Auto Trait Implementations

impl<Sink, A> RefUnwindSafe for Decoder<Sink, A> where
    A: RefUnwindSafe,
    Sink: RefUnwindSafe
[src]

impl<Sink, A> Send for Decoder<Sink, A> where
    A: Send,
    Sink: Send
[src]

impl<Sink, A> Sync for Decoder<Sink, A> where
    A: Sync,
    Sink: Sync
[src]

impl<Sink, A> Unpin for Decoder<Sink, A> where
    A: Unpin,
    Sink: Unpin
[src]

impl<Sink, A> UnwindSafe for Decoder<Sink, A> where
    A: UnwindSafe,
    Sink: UnwindSafe
[src]

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, 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.