3 ms·
<> is used in Rust similar to how C++ uses them in templates. ArrayVec::new() is a generic function that takes two generic arguments: a type (&[u8; CHUNK_LEN])
by cornstalks 5y ago
<> is used in Rust similar to how C++ uses them in templates.
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.