VecDeque should expose head via head_index() (or similarly named)

VecDeque (sensibly) uses indexing to index in queue order, so deque.get(0) is always identical to deque.front(). However, this makes it almost impossible to index consistently into the physical buffer - if you wish to keep a handle to a piece of data inside the deque (and references are out because of borrow-checking limitations), you need to (re)do math on the logical index to remap to the physical index.

Doing this math requires knowing the position of the head of the deque, which the data structure obviously knows. The best way I've found to attempt to track it is this, which has big limitations:

    let mut foo = VecDeque::<i32>::with_capacity(32);
    // Need an element to use front(). AFAICT, there is no way to get a reference to the beginning
    // of the physical buffer without inserting at least one item.
    foo.push_back(0);
    let head: *const i32 = foo.front().unwrap();
    foo.pop_front();
    foo.push_back(10);
    println!("Current head_index is {}", unsafe {
        (foo.front().unwrap() as *const i32).offset_from(head)
    });

Aside from requiring unsafe, this breaks if the buffer is reallocated between capturing head and using it in offset_from(), which may be hard to guard against, depending on your application.

Exposing the head index would be a very simple addition, and I don't think it would lock the data structure into any invariants it doesn't already have. Can we get this accessor?

Why are you indexing into the physical buffer instead of reusing get? Your proposed head_index also doesn't survive reallocations.