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
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • 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::AsyncBincodeWriter
    A wrapper around an asynchronous sink that accepts, …
    struct
    async_bincode::tokio::AsyncBincodeWriter
    A wrapper around an asynchronous sink that accepts, …
    method
    async_bincode::futures::AsyncBincodeWriter::into_inner
    AsyncBincodeWriter<W, T, D> -> W
    Unwraps this AsyncBincodeWriter, returning the underlying …
    method
    async_bincode::tokio::AsyncBincodeWriter::into_inner
    AsyncBincodeWriter<W, T, D> -> W
    Unwraps this AsyncBincodeWriter, returning the underlying …
    method
    async_bincode::futures::AsyncBincodeWriter::get_ref
    &AsyncBincodeWriter<W, T, D> -> &W
    Gets a reference to the underlying writer.
    method
    async_bincode::tokio::AsyncBincodeWriter::get_ref
    &AsyncBincodeWriter<W, T, D> -> &W
    Gets a reference to the underlying writer.
    method
    async_bincode::futures::AsyncBincodeWriter::for_sync
    AsyncBincodeWriter<W, T, AsyncDestination> -> AsyncBincodeWriter<W, T, SyncDestination>
    Make this writer only send bincode-encoded values.
    method
    async_bincode::tokio::AsyncBincodeWriter::for_sync
    AsyncBincodeWriter<W, T, AsyncDestination> -> AsyncBincodeWriter<W, T, SyncDestination>
    Make this writer only send bincode-encoded values.
    method
    async_bincode::futures::AsyncBincodeWriter::for_async
    AsyncBincodeWriter<W, T, SyncDestination> -> AsyncBincodeWriter<W, T, AsyncDestination>
    Make this writer include the serialized data’s size …
    method
    async_bincode::tokio::AsyncBincodeWriter::for_async
    AsyncBincodeWriter<W, T, SyncDestination> -> AsyncBincodeWriter<W, T, AsyncDestination>
    Make this writer include the serialized data’s size …
    method
    async_bincode::futures::AsyncBincodeWriter::get_mut
    &mut AsyncBincodeWriter<W, T, D> -> &mut W
    Gets a mutable reference to the underlying writer.
    method
    async_bincode::tokio::AsyncBincodeWriter::get_mut
    &mut AsyncBincodeWriter<W, T, D> -> &mut W
    Gets a mutable reference to the underlying writer.
    method
    async_bincode::futures::AsyncBincodeWriter::fmt
    &AsyncBincodeWriter<W, T, D>, &mut Formatter -> Result
    method
    async_bincode::tokio::AsyncBincodeWriter::fmt
    &AsyncBincodeWriter<W, T, D>, &mut Formatter -> Result
    method
    async_bincode::futures::AsyncBincodeWriter::from
    W -> AsyncBincodeWriter<W, T, SyncDestination>
    method
    async_bincode::tokio::AsyncBincodeWriter::from
    W -> AsyncBincodeWriter<W, T, SyncDestination>
    method
    async_bincode::futures::AsyncBincodeWriter::default
    -> AsyncBincodeWriter<W, T, SyncDestination>
    method
    async_bincode::tokio::AsyncBincodeWriter::default
    -> AsyncBincodeWriter<W, T, SyncDestination>
    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.
    method
    async_bincode::futures::AsyncBincodeWriter::for_sync
    AsyncBincodeWriter<W, T, AsyncDestination> -> AsyncBincodeWriter<W, T, SyncDestination>
    Make this writer only send bincode-encoded values.
    method
    async_bincode::tokio::AsyncBincodeWriter::for_sync
    AsyncBincodeWriter<W, T, AsyncDestination> -> AsyncBincodeWriter<W, T, SyncDestination>
    Make this writer only send bincode-encoded values.
    method
    async_bincode::futures::AsyncBincodeWriter::for_async
    AsyncBincodeWriter<W, T, SyncDestination> -> AsyncBincodeWriter<W, T, AsyncDestination>
    Make this writer include the serialized data’s size …
    method
    async_bincode::tokio::AsyncBincodeWriter::for_async
    AsyncBincodeWriter<W, T, SyncDestination> -> AsyncBincodeWriter<W, T, AsyncDestination>
    Make this writer include the serialized data’s size …