ergo_lib/utils.rs
1/// Get the length of constant sized arrays.
2///
3/// ```
4/// use ergo_lib::ArrLength;
5///
6/// type SecretKeyBytes = [u8; 32];
7///
8/// assert_eq!(32, SecretKeyBytes::LEN)
9/// ```
10pub trait ArrLength {
11 /// Length of the array
12 const LEN: usize;
13}
14
15impl<T, const LENGTH: usize> ArrLength for [T; LENGTH] {
16 const LEN: usize = LENGTH;
17}