This is a little blog post I've been working on over the past couple days. If you like low-level data structures, writing correct unsafe code, or embedded programming, you may find this interesting.
first, what does the brackets wrapped around N mean? (i.e., { N }).
Also, why is this declared a constant function when the len can change throughout runtime? I definitely feel like I'm missing some basic concept/definition here
closure? If you're talking about const fn, right now there you can't branch, loop, or do anything intrinsically unsafe. You can call unsafe const functions, but they can't do anything intrinsically unsafe (like dereferencing a raw pointer). There are a few other things, but this is the most of it. This is mainly due to prevent stabilizing bugs. Right now the compiler is capable of running most things, but only with a very unstable flag, (I don't remember the name, but it was something along the lines of -Zrelease-the-miri-within, or something like that)
This is useful, because it allows you to compute values at compile time and put them into static. For example, in the future I could have a Mutex<Vec<i32>> without lazy-static or similar.
Making something a const fn is a way to let the compiler run code at compile time (see Compile Time Function Execution). The primary use for CTFE is when initializing const or static variables, for example imagine being able to pre-calculate an expensive lookup table or whatever. Declaring the remaining_capacity() method as a const fn would allow consumers of remaining_capacity() to use it in their own const fn functions.
One use might be to initialize a cache with known "hot" values at compile time, while still leaving enough remaining capacity to avoid cache evictions early on? That's probably a bit contrived but I have no idea what people might want to use ArrayVec for, so I tried to make as many things const fn as possible to not impose any unnecessary limitations.