A very silly base trait
at main 558 B view raw
1//! Const Init 2 3#![no_std] 4 5/// A simple trait that can be used as a bound for "can be const created". 6/// 7/// Think of it like the [`Default`](core::default::Default) trait, but 8/// for const values. 9/// 10/// Useful for cases where you want a `const fn new() -> Self`, but only 11/// for a subset of types that can be statically created, such as inline 12/// buffers vs heap allocated buffers. 13/// 14/// I got tired of writing this in multiple crates, so now it's its own crate. 15pub trait ConstInit { 16 /// The default value of this type 17 const INIT: Self; 18}