[][src]Function array_tools::length_of

pub fn length_of<T, A: FixedSizeArray<T>>() -> usize

A functiona akin to size_of, but computes length of array.

It is not much useful if array length is known, but in generic contexts where only FixedSizeArray trait is given, it may come in handy.

use array_tools;

let length = array_tools::length_of::<u64, [u64; 7]>();
assert_eq!(length, 7);

Note

Currently it is not a const fn, but this should be fixed in future.