Docs.rs
  • async-bincode-0.8.0
    • async-bincode 0.8.0
    • Permalink
    • Docs.rs crate page
    • MIT/Apache-2.0
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • jonhoo
    • fintelia
    • Dependencies
      • bincode ^2.0.1 normal
      • byteorder ^1.0.0 normal
      • bytes ^1.0 normal
      • futures-core ^0.3.0 normal
      • futures-io ^0.3.21 normal optional
      • futures-sink ^0.3.0 normal
      • serde ^1.0.100 normal
      • tokio ^1.0 normal optional
      • futures ^0.3.0 dev
      • macro_rules_attribute ^0.2.0 dev
      • smol ^2.0.2 dev
      • smol-macros ^0.1.1 dev
      • tokio ^1.0 dev
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • Rust
    • About docs.rs
    • Privacy policy
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate async_bincode

async_bincode0.8.0

  • All Items

Crate Items

  • Modules
  • Structs

Crates

  • async_bincode

Crate async_bincode

Source
Expand description

Asynchronous access to a bincode-encoded item stream.

This crate enables you to asynchronously read from a bincode-encoded stream, or write bincoded-encoded values. bincode does not support this natively, as it cannot easily resume from stream errors while encoding or decoding.

async-bincode works around that on the receive side by buffering received bytes until a full element’s worth of data has been received, and only then calling into bincode. To make this work, it relies on the sender to prefix each encoded element with its encoded size.

On the write side, async-bincode buffers the serialized values, and asynchronously sends the resulting bytestream.

This crate provides two sets of types in two separate modules. The types in the futures module work with the futures_io/async-std ecosystem. The types in the tokio module work with the tokio ecosystem.

Modules§

futures
Asynchronous access to a bincode-encoded item stream using futures_io. See the top-level documentation and the documentation for AsyncBincodeReader, AsyncBincodeWriter, and AsyncBincodeStream.
tokio
Asynchronous access to a bincode-encoded item stream using tokio. See the top-level documentation and the documentation for AsyncBincodeReader, AsyncBincodeWriter, and AsyncBincodeStream.

Structs§

AsyncDestination
A marker that indicates that the wrapping type is compatible with AsyncBincodeReader.
SyncDestination
A marker that indicates that the wrapping type is compatible with stock bincode receivers.

Results

Settings
Help
    struct
    async_bincode::futures::AsyncBincodeReader
    A wrapper around an asynchronous reader that produces an …
    struct
    async_bincode::tokio::AsyncBincodeReader
    A wrapper around an asynchronous reader that produces an …
    method
    async_bincode::futures::AsyncBincodeReader::into_inner
    AsyncBincodeReader<R, T> -> R
    Unwraps this AsyncBincodeReader, returning the underlying …
    method
    async_bincode::tokio::AsyncBincodeReader::into_inner
    AsyncBincodeReader<R, T> -> R
    Unwraps this AsyncBincodeReader, returning the underlying …
    method
    async_bincode::futures::AsyncBincodeReader::get_ref
    &AsyncBincodeReader<R, T> -> &R
    Gets a reference to the underlying reader.
    method
    async_bincode::tokio::AsyncBincodeReader::get_ref
    &AsyncBincodeReader<R, T> -> &R
    Gets a reference to the underlying reader.
    method
    async_bincode::futures::AsyncBincodeReader::buffer
    &AsyncBincodeReader<R, T> -> &[u8]
    Returns a reference to the internally buffered data.
    method
    async_bincode::tokio::AsyncBincodeReader::buffer
    &AsyncBincodeReader<R, T> -> &[u8]
    Returns a reference to the internally buffered data.
    method
    async_bincode::futures::AsyncBincodeReader::get_mut
    &mut AsyncBincodeReader<R, T> -> &mut R
    Gets a mutable reference to the underlying reader.
    method
    async_bincode::tokio::AsyncBincodeReader::get_mut
    &mut AsyncBincodeReader<R, T> -> &mut R
    Gets a mutable reference to the underlying reader.
    method
    async_bincode::futures::AsyncBincodeReader::fmt
    &AsyncBincodeReader<R, T>, &mut Formatter -> Result
    method
    async_bincode::tokio::AsyncBincodeReader::fmt
    &AsyncBincodeReader<R, T>, &mut Formatter -> Result
    method
    async_bincode::futures::AsyncBincodeReader::from
    R -> AsyncBincodeReader<R, T>
    method
    async_bincode::tokio::AsyncBincodeReader::from
    R -> AsyncBincodeReader<R, T>
    method
    async_bincode::futures::AsyncBincodeReader::default
    -> AsyncBincodeReader<R, T>
    method
    async_bincode::tokio::AsyncBincodeReader::default
    -> AsyncBincodeReader<R, T>
    method
    async_bincode::tokio::AsyncBincodeStream::tcp_split
    &mut AsyncBincodeStream<TcpStream, R, W, D> -> (AsyncBincodeReader<ReadHalf, R>, AsyncBincodeWriter<WriteHalf, W, D>)
    Split a TCP-based stream into a read half and a write half.