Registry / networking / tokio-codec

tokio-codec

JSON →
library0.1.2rscratesunverified

Utilities for encoding and decoding frames.

# Cargo.toml [dependencies] tokio-codec = "0.1.2"
INSTALL
IMPORT
SIG · TOKIO-CODEC
T
tokio-codec
networkingrustv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Decoder
use tokio_codec::Decoder;

Implements a custom decoder for framing data.

use tokio_codec::Decoder; use bytes::BytesMut; struct MyDecoder; impl Decoder for MyDecoder { type Item = String; type Error = std::io::Error; fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> { // implementation Ok(None) } }
Debug
Known issues
breakingDeprecated in favor of `tokio-util` codec utilities.
fix
Use `tokio_util::codec` instead.
affects: >=0.2.0
Upgrade
Version history
0.1.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
tokio-codec — cargo add tokio-codec · libregistry