let mut chunks = ArrayVec::<&[u8; CHUNK_LEN], NUM_INPUTS>::new();
Edit:I probably should not comment to everyone one-by-one, so thank you all for the answers!
Now, what we have here is commonly referred to as the Turbo Fish[0] operator (the `::<>` syntax). In this case it's there to help let the compiler know which concrete type you want to create your new `ArrayVec` with :)
[0]: https://doc.rust-lang.org/1.30.0/book/first-edition/generics...
Foo<T> supports more types, often limited with certain traits they must support.
Here it's passing the actual type on instantiation, in that case there are two types: an u8 slice and a number of inputs, just guestimating the latter as I did not check the original definition in the source.
See https://doc.rust-lang.org/book/ch10-01-syntax.html for a better explanation.
ArrayVec::new() is a generic function that takes two generic arguments: a type (&[u8; CHUNK_LEN]) and a value (NUM_INPUTS). So ArrayVec is the structure, <...> are the generic arguments (I replaced stuff with ellipses for brevity), and new() is the function call. :: is used as a "path" separator to syntactically differentiate between all these different parts.
1. https://docs.rs/arrayvec/0.7.1/arrayvec/struct.ArrayVec.html
So `ArrayVec::<T, const CAPACITY: usize>` is an ArrayVec of items of type T, with capacity CAPACITY (of type usize, think size_t). An ArrayVec is a vector backed by a fixed-size array. Basically an array with convenience methods on it.[1]
In this case, T is `&[u8; CHUNK_LEN]` and `CAPACITY` is `NUM_INPUTS`. `&[u8; CHUNK_LEN]` is roughly equivalent to a `uint8_t* array[CHUNK_LEN]`.
So to simplify even more it's a fixed-size vector of byte arrays. The details of why it's not quite equivalent to that C code (how Rust checks the safety) are beyond the scope of this comment.
[1] https://docs.rs/arrayvec/0.7.1/arrayvec/struct.ArrayVec.html