Crates.io | generic-arrayvec |
lib.rs | generic-arrayvec |
version | 0.4.0 |
source | src |
created_at | 2018-07-15 03:47:31.397731 |
updated_at | 2022-07-27 06:21:37.988659 |
description | Interop between the arrayvec and generic_array crates |
homepage | |
repository | https://github.com/Seeker14491/generic-arrayvec |
max_upload_size | |
id | 74291 |
size | 31,456 |
This crate provides interop between the arrayvec
v0.5 and
generic_array
crates, allowing you to use generic_array
's GenericArray
datatype as the backing storage for the data structures in arrayvec
. This lets you have vector and string types that
store their contents inline, with a capacity that can be referred to in generic code.
Note that as of its v0.6 release, arrayvec
uses Rust's const generics feature to
implement functionality similar to this crate but with better ergonomics, so you may not need this crate anymore. Still,
const generics currently has some limitations on stable Rust which
the approach this crate uses does not, so this crate can still be useful. Also, this crate can be a bit more memory
efficient due to its vectors storing their length using 1 byte when capacity < 2^8
, 2 bytes when capacity < 2^16
,
etc; in comparison arrayvec
as of v0.7.2 always uses 4 bytes for this.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.