const-slice 0.1.0

working with slices in compile-time constants
Documentation
  • Coverage
  • 100%
    17 out of 17 items documented0 out of 16 items with examples
  • Size
  • Source code size: 7.48 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • soqb

const-slice

Compile-time constant variants of several slice types over dynamically allocated types, implemented as slices over a fixed-capacity array (controlled by const generics).

The types in this crate will panic at compile-time if they would exceed the size of their array (currently produces a very unhelpful error - see #51999)

Examples

const FIRST: &str = "mary had a";
const SECOND: &str = " little lamb.";

const BOTH: ConstString<32> = ConstString::from_str(FIRST).with_str(SECOND);

assert_eq!(BOTH, ConstString::from_str("mary had a little lamb."));