Macro zeroslice
macro_rules! zeroslice {
() => { ... };
($aligned:ty; $convert:expr; [$($x:expr),+ $(,)?]) => { ... };
}
Convenience wrapper for ZeroSlice::from_ule_slice. The value will be created at compile-time,
meaning that all arguments must also be constant.
Arguments
$aligned- The type of an element in its canonical, aligned form, e.g.,char.$convert- A const function that converts an$alignedinto its unaligned equivalent, e.g., const fn from_aligned(a: CanonicalType) -> CanonicalType::ULE`.$x- The elements that theZeroSlicewill hold.
Examples
Using array-conversion functions provided by this crate:
use ;
const SIGNATURE: & = zeroslice!;
const EMPTY: & = zeroslice!;
let empty: & = zeroslice!;
let nums = zeroslice!;
assert_eq!;
Using a custom array-conversion function:
use ;
const
const NUMBERS_BE: & =
zeroslice!;