Module vonuvoli_scheme::externals::blake2::digest::generic_array[]

This crate implements a structure that can be used as a generic array type.use Core Rust array types [T; N] can't be used generically with respect to N, so for example this:

struct Foo<T, N> {
    data: [T; N]
}

won't work.

generic-array exports a GenericArray<T,N> type, which lets the above be implemented as:

struct Foo<T, N: ArrayLength<T>> {
    data: GenericArray<T,N>
}

The ArrayLength<T> trait is implemented by default for unsigned integer types from typenum.

For ease of use, an arr! macro is provided - example below:

let array = arr![u32; 1, 2, 3];
assert_eq!(array[2], 3);

Modules

arr

Implementation for arr! macro.

iter

GenericArray iterator implementation.

typenum

This crate provides type-level numbers evaluated at compile time. It depends only on libcore.

Structs

GenericArray

Struct representing a generic array - GenericArray<T, N> works like [T; N]

Traits

ArrayLength

Trait making GenericArray work, marking types to be used as length of an array

Functions

transmute

Reinterprets the bits of a value of one type as another type.