Function array_tools::length_of[][src]

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

Returns the length of array.

Though it is not much useful when concrete array type is given and it's size is known, it may come in handy when dealing with arrays hidden behind FixedSizeArray in generic contexts.

Examples

use array_tools::length_of;

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

Note

Though currently it seems impossible to covert this one into const fn, this sure will be done when this will become possible.