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