48 releases (13 stable)

1.8.0 Oct 21, 2024
1.7.1 Aug 1, 2024
1.7.0 Jul 31, 2024
1.6.0 Mar 22, 2024
0.2.3 Mar 30, 2015

#15 in Rust patterns

Download history 2423971/week @ 2024-07-19 2490715/week @ 2024-07-26 2539563/week @ 2024-08-02 2603785/week @ 2024-08-09 2482425/week @ 2024-08-16 2550241/week @ 2024-08-23 2456447/week @ 2024-08-30 2578495/week @ 2024-09-06 2393284/week @ 2024-09-13 2858594/week @ 2024-09-20 2861976/week @ 2024-09-27 3345691/week @ 2024-10-04 3161885/week @ 2024-10-11 3427372/week @ 2024-10-18 2881159/week @ 2024-10-25 2320846/week @ 2024-11-01

12,316,235 downloads per month
Used in 35,758 crates (6,487 directly)

MIT license

230KB
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