const-init

Crates.ioconst-init
lib.rsconst-init
version1.0.0
created_at2025-07-04 13:36:17.130312+00
updated_at2025-07-04 13:36:52.97655+00
descriptionA simple trait for things that are const initializable
homepage
repositoryhttps://tangled.sh/@jamesmunns.com/const-init
max_upload_size
id1738022
size15,075
James Munns (jamesmunns)

documentation

https://docs.rs/const-init/

README

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.

License

Licensed under either of

at your option.

Contribution

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.

Commit count: 0

cargo fmt