#byte #memory-management #generics #octets

no-std octseq

Abstractions for types representing octet sequences

8 releases (4 breaking)

0.5.1 Feb 13, 2024
0.5.0 Jan 30, 2024
0.4.0 Jan 10, 2024
0.3.2 Dec 28, 2023
0.1.0 Aug 18, 2022

#159 in Rust patterns

Download history 7834/week @ 2023-12-14 4635/week @ 2023-12-21 5804/week @ 2023-12-28 8393/week @ 2024-01-04 11654/week @ 2024-01-11 9805/week @ 2024-01-18 10288/week @ 2024-01-25 14244/week @ 2024-02-01 9273/week @ 2024-02-08 13215/week @ 2024-02-15 12691/week @ 2024-02-22 15469/week @ 2024-02-29 12925/week @ 2024-03-07 11579/week @ 2024-03-14 12474/week @ 2024-03-21 10580/week @ 2024-03-28

49,374 downloads per month
Used in 16 crates (6 directly)

BSD-3-Clause

94KB
2K SLoC

octseq - Generic Octets Sequences

Octets sequences, i.e., variable length sequences of bytes, require a varying amount of memory and different use cases suggest different strategies to manage that memory: references to u8 slices, Vec<u8>, Arc<[u8]> are examples provided by the standard library.

In many cases, underlying memory management strategies don’t matter for composite types storing such octets sequences or for code manipulating them. Instead of insisting on a specific representation, these types and functions can be generic over the representation and describe the necessary properties through trait bounds.

This crate provides a set of such traits that describe basic functionality of octets sequences as well as buffers to construct such sequences, termed octets builders, conversions between sequences and builders.

It also provides some helper types that simplify common tasks such as parsing data from an octets sequence.

For details, please see the crate documentation on docs.rs.

Contributing

If you have comments, proposed changes, or would like to contribute, please open an issue in the Github repository. In particular, if you would like to use the crate but it is missing functionality for your use case, we would love to hear from you!

License

The octseq crate is distributed under the terms of the BSD-3-clause license. See LICENSE for details.

Dependencies

~0–345KB