pub struct DirtyLine(/* private fields */);Expand description
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.
Implementations§
Trait Implementations§
Source§impl Decoder for DirtyLine
impl Decoder for DirtyLine
Source§fn decode(&mut self, src: &mut BytesMut) -> IoResult<Option<Parsed>>
fn decode(&mut self, src: &mut BytesMut) -> IoResult<Option<Parsed>>
Attempts to decode a frame from the provided buffer of bytes. Read more
Auto Trait Implementations§
impl Freeze for DirtyLine
impl RefUnwindSafe for DirtyLine
impl Send for DirtyLine
impl Sync for DirtyLine
impl Unpin for DirtyLine
impl UnwindSafe for DirtyLine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more