const-init 1.0.0

A simple trait for things that are const initializable
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 14.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 468.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jamesmunns

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.