24 stable releases (7 major)

new 10.0.0 Jan 17, 2025
9.1.0 Jun 12, 2024
8.3.0 Jan 18, 2024
8.1.0 Jun 12, 2023
3.0.2 Jul 19, 2022

#116 in Asynchronous

Download history 2254/week @ 2024-09-27 2753/week @ 2024-10-04 2598/week @ 2024-10-11 2725/week @ 2024-10-18 2064/week @ 2024-10-25 2464/week @ 2024-11-01 3483/week @ 2024-11-08 1809/week @ 2024-11-15 1437/week @ 2024-11-22 1006/week @ 2024-11-29 1404/week @ 2024-12-06 1461/week @ 2024-12-13 996/week @ 2024-12-20 950/week @ 2024-12-27 1980/week @ 2025-01-03 1474/week @ 2025-01-10

5,598 downloads per month
Used in 28 crates (11 directly)

MIT license

72KB
1.5K SLoC

Binary Stream

A binary stream reader and writer.

Credits

Derived from the binary_rw crate.


lib.rs:

Read and write binary data to streams.

An asynchronous version using futures::io is available using the async feature and if the tokio feature flag is given then the implementation will use the traits from tokio::io instead which avoids the need to use the compat traits from tokio-util if you are using the tokio runtime.

Strings are length prefixed using u32 by default, use the 64bit feature if you really need huge strings.

Encode and decode implementations are provided for all primitive types and blanket implementations for Option<T> and Vec<T>; the blank implementation for Vec<T> is length prefixed using a u32 so will panic if it is longer than u32::MAX.

Dependencies

~0–6MB
~24K SLoC