Crates.io | miny |
lib.rs | miny |
version | 2.0.3 |
created_at | 2023-07-11 14:18:46.815216+00 |
updated_at | 2025-06-03 16:05:13.271146+00 |
description | Box |
homepage | https://github.com/1e1001/rsutil/tree/main/miny |
repository | https://github.com/1e1001/rsutil/tree/main/miny |
max_upload_size | |
id | 913818 |
size | 20,974 |
A Box<T>
with T
stored inline for values less than a pointer in size. Requires nightly Rust & alloc
use miny::Miny;
let small = Miny::new(1_u8);
let large = Miny::new([1_usize; 32]);
// small is stored inline on the stack
assert!(Miny::on_stack(&small));
// large is stored with an allocation
assert!(!Miny::on_stack(&large));
// consume the miny and get back a value
let original = Miny::into_inner(large);
assert_eq!(original, [1; 32]);
For more information, read the docs.
Box
(thanks, Cormac!)rsutil
merge documentation overhaulptr
API'sMIT or Apache 2.0
(also hi please give me suggestions for more features to add, this crate feels kinda small)