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]

A constructor

Trait Implementations

impl Debug for DirtyLine
[src]

Formats the value using the given formatter.

impl Default for DirtyLine
[src]

Returns the "default value" for a type. Read more

impl Decoder for DirtyLine
[src]

The type of decoded frames.

The type of unrecoverable frame decoding errors. Read more

Attempts to decode a frame from the provided buffer of bytes. Read more

A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more

impl Encoder for DirtyLine
[src]

The type of items consumed by the Encoder

The type of encoding errors. Read more

Encodes a frame into the buffer provided. Read more