44 releases (9 stable)

1.6.0 Mar 22, 2024
1.5.0 Sep 7, 2023
1.4.0 Jan 31, 2023
1.3.0 Nov 21, 2022
0.2.3 Mar 30, 2015

#8 in Rust patterns

Download history 986610/week @ 2023-12-23 1329462/week @ 2023-12-30 1649205/week @ 2024-01-06 1702053/week @ 2024-01-13 1781927/week @ 2024-01-20 1975862/week @ 2024-01-27 1908531/week @ 2024-02-03 1894819/week @ 2024-02-10 1916580/week @ 2024-02-17 2018990/week @ 2024-02-24 2028567/week @ 2024-03-02 1976915/week @ 2024-03-09 1980345/week @ 2024-03-16 2136583/week @ 2024-03-23 2096852/week @ 2024-03-30 1723127/week @ 2024-04-06

8,252,498 downloads per month
Used in 29,744 crates (5,696 directly)

MIT license

220KB
3.5K SLoC

Bytes

A utility library for working with bytes.

Crates.io Build Status

Documentation

Usage

To use bytes, first add this to your Cargo.toml:

[dependencies]
bytes = "1"

Next, add this to your crate:

use bytes::{Bytes, BytesMut, Buf, BufMut};

Serde support

Serde support is optional and disabled by default. To enable use the feature serde.

[dependencies]
bytes = { version = "1", features = ["serde"] }

Building documentation

When building the bytes documentation the docsrs option should be used, otherwise feature gates will not be shown. This requires a nightly toolchain:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in bytes by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies

~180KB