[−][src]Struct marked::Decoder
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]
Sink: TendrilSink<UTF8, A>,
A: Atomicity,
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]
Self: Sized,
R: Read,
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]
Sink: TendrilSink<UTF8, A>,
A: Atomicity,
type Output = Sink::Output
What the overall result of processing is.
pub fn process(&mut self, t: Tendril<Bytes, A>)
[src]
pub fn error(&mut self, desc: Cow<'static, str>)
[src]
pub fn finish(self) -> Sink::Output
[src]
pub fn one<T>(self, t: T) -> Self::Output where
T: Into<Tendril<F, A>>,
[src]
T: Into<Tendril<F, A>>,
pub fn from_iter<I>(self, i: I) -> Self::Output where
I: IntoIterator,
<I as IntoIterator>::Item: Into<Tendril<F, A>>,
[src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<Tendril<F, A>>,
pub fn read_from<R>(self, r: &mut R) -> Result<Self::Output, Error> where
R: Read,
F: SliceFormat<Slice = [u8]>,
[src]
R: Read,
F: SliceFormat<Slice = [u8]>,
pub fn from_file<P>(self, path: P) -> Result<Self::Output, Error> where
P: AsRef<Path>,
F: SliceFormat<Slice = [u8]>,
[src]
P: AsRef<Path>,
F: SliceFormat<Slice = [u8]>,
Auto Trait Implementations
impl<Sink, A> RefUnwindSafe for Decoder<Sink, A> where
A: RefUnwindSafe,
Sink: RefUnwindSafe,
[src]
A: RefUnwindSafe,
Sink: RefUnwindSafe,
impl<Sink, A> Send for Decoder<Sink, A> where
A: Send,
Sink: Send,
[src]
A: Send,
Sink: Send,
impl<Sink, A> Sync for Decoder<Sink, A> where
A: Sync,
Sink: Sync,
[src]
A: Sync,
Sink: Sync,
impl<Sink, A> Unpin for Decoder<Sink, A> where
A: Unpin,
Sink: Unpin,
[src]
A: Unpin,
Sink: Unpin,
impl<Sink, A> UnwindSafe for Decoder<Sink, A> where
A: UnwindSafe,
Sink: UnwindSafe,
[src]
A: UnwindSafe,
Sink: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,