Crates.io | const-init |
lib.rs | const-init |
version | 1.0.0 |
created_at | 2025-07-04 13:36:17.130312+00 |
updated_at | 2025-07-04 13:36:52.97655+00 |
description | A simple trait for things that are const initializable |
homepage | |
repository | https://tangled.sh/@jamesmunns.com/const-init |
max_upload_size | |
id | 1738022 |
size | 15,075 |
const-init
A simple trait that can be used as a bound for "can be const created".
Think of it like the Default
trait, but for const values.
Useful for cases where you want a const fn new() -> Self
, but only
for a subset of types that can be statically created, such as inline
buffers vs heap allocated buffers.
I got tired of writing this in multiple crates, so now it's its own crate.
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.