#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

#166 in Rust patterns

Download history 15822/week @ 2024-02-28 12986/week @ 2024-03-06 10490/week @ 2024-03-13 12552/week @ 2024-03-20 13246/week @ 2024-03-27 12193/week @ 2024-04-03 12706/week @ 2024-04-10 10799/week @ 2024-04-17 11622/week @ 2024-04-24 11367/week @ 2024-05-01 11512/week @ 2024-05-08 9628/week @ 2024-05-15 10619/week @ 2024-05-22 10347/week @ 2024-05-29 13467/week @ 2024-06-05 13269/week @ 2024-06-12

49,843 downloads per month
Used in 20 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–335KB