[][src]Crate fixed_buffer_tokio

This is a Rust library with fixed-size buffers, useful for network protocol parsers and file parsers.

This is the tokio async version of fixed-buffer.

Features

  • Write bytes to the buffer and read them back
  • Lives on the stack
  • Does not allocate memory
  • Use it to read a stream, search for a delimiter, and save leftover bytes for the next read.
  • Easy to learn & use. Easy to maintain code that uses it.
  • Depends only on std, tokio 0.3, and fixed-buffer.
  • Works with Tokio 0.3 and Rust latest, beta, and nightly
  • No macros
  • Good test coverage (98%)

Documentation

https://docs.rs/fixed-buffer-tokio

Examples

For a complete example, see tests/server.rs.

Alternatives

Release Process

  1. Edit Cargo.toml and bump version number.
  2. Run ../release.sh

Changelog

  • v0.1.0 - First published version

Structs

AsyncFixedBuf

A newtime that wraps FixedBuf and implements tokio::io::AsyncRead and tokio::io::AsyncWrite.

AsyncReadWriteChain

A wrapper for a pair of structs. The first implements AsyncRead. The second implements AsyncRead+AsyncWrite.

AsyncReadWriteTake

Wraps a struct that implements AsyncRead+AsyncWrite. Passes through reads and writes to the struct. Limits the number of bytes that can be read.