#traits #const #init #got #bounds #tired #initializable

no-std const-init

A simple trait for things that are const initializable

2 releases (1 stable)

Uses new Rust 2024

1.0.0 Jul 4, 2025
0.1.0 Jul 4, 2025

#2084 in Embedded development

Download history 1855/week @ 2026-04-17 1550/week @ 2026-04-24 1528/week @ 2026-05-01 1885/week @ 2026-05-08 1719/week @ 2026-05-15 1896/week @ 2026-05-22 1885/week @ 2026-05-29 1739/week @ 2026-06-05 1859/week @ 2026-06-12 1788/week @ 2026-06-19 1598/week @ 2026-06-26 1436/week @ 2026-07-03 1319/week @ 2026-07-10 1732/week @ 2026-07-17 1934/week @ 2026-07-24 2073/week @ 2026-07-31

7,229 downloads per month
Used in 9 crates (2 directly)

MIT/Apache

6KB

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.

No runtime deps