| Crates.io | uninit_buffers |
| lib.rs | uninit_buffers |
| version | 0.1.1 |
| created_at | 2025-07-02 19:44:13.45967+00 |
| updated_at | 2025-07-02 19:48:14.001782+00 |
| description | Safe uninitialized buffers that take input from functions or iterators. |
| homepage | https://jamespetersen.ca/uninit_buffers |
| repository | https://github.com/ljtpetersen/uninit_buffers |
| max_upload_size | |
| id | 1735514 |
| size | 43,463 |
This crate aims to fill a hole in the currently-unstable MaybeUninit slice-filling API: there is
a safe way to fill a slice, but there is no safe way to drop elements of the slice. For this purpose,
we introduce a wrapper type, Initialized, which will drop the initialized elements when it goes out of scope.
Regarding safety, we treat the Initialized structure as if it owns the elements thar are filled. It is instantiated
by using the SliceExt trait, which is implemented on all MaybeUninit slices.
This crate is on crates.io and can beused
by executing cargo add uninit_buffers or by adding the following to the dependencies in your
Cargo.toml file.
[dependencies]
uninit_buffers = "0.1"
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.
Feel free to put a copyright header in your name in any files you contribute to.
Copyright (C) 2025 James Petersen m@jamespetersen.ca.
The SliceExt trait implementation and documentation on MaybeUninit slices is heavily influenced (mostly copied)
from the corresponding implementation in the Rust standard library, with minor adjustments where necessary to accomodate
the Initialized structure as well as any missing unstable features.