Struct tokio_jsonrpc::codec::DirtyLine
[−]
[src]
pub struct DirtyLine(_);
A codec working with JSONRPC 2.0 messages on top of badly encoded utf-8.
This works like the Line codec. However, it can cope with the input not
being valid utf-8. That is arguably broken, nevertheless found in the wild and sometimes the
only thing left to be done is to cope with it. This copes with it by running the input through
the String::from_utf8_lossy
conversion, effectively replacing anything that is not valid with
these special utf-8 WTF question marks (U+FFFD).
In contrast, Line errors on such invalid inputs. Encoding is the same for both codecs, however.
Methods
impl DirtyLine
[src]
fn new() -> Self
A constructor
Trait Implementations
impl Debug for DirtyLine
[src]
impl Default for DirtyLine
[src]
impl Decoder for DirtyLine
[src]
type Item = Parsed
The type of decoded frames.
type Error = Error
The type of unrecoverable frame decoding errors. Read more
fn decode(&mut self, src: &mut BytesMut) -> IoResult<Option<Parsed>>
Attempts to decode a frame from the provided buffer of bytes. Read more
fn decode_eof(
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more