A very silly base trait
Rust 4.5%
Other 95.5%
2 1 1

Clone this repository

https://tangled.org/jamesmunns.com/const-init
git@tangled.org:jamesmunns.com/const-init

For self-hosted knots, clone URLs may differ based on your setup.

README.md

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.