Crates.io | buf-trait |
lib.rs | buf-trait |
version | 0.4.1 |
source | src |
created_at | 2023-12-26 04:04:00.385098 |
updated_at | 2023-12-27 22:27:50.211925 |
description | abstract over [u8], str, and friends |
homepage | https://github.com/mcy/strings |
repository | https://github.com/mcy/strings |
max_upload_size | |
id | 1080615 |
size | 8,066 |
The Buf
trait.
This crate provides a trait for abstracting over buffer-like types, such
as str
and [u8]
. This is a much stronger property than, say,
implementing [AsRef<[u8]>
]. These are variable-length types that you might
want to store as a raw byte buffer and then transmute to and from &[u8]
.
This crate provides all the functionality necessary for doing so safely,
correctly, and in const
.