const-init 1.0.0

A simple trait for things that are const initializable
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Const Init

#![no_std]

/// A simple trait that can be used as a bound for "can be const created".
///
/// Think of it like the [`Default`](core::default::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.
pub trait ConstInit {
    /// The default value of this type
    const INIT: Self;
}