VecDeque should expose head via head_index() (or similarly named)
Rust Internals
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 st...
0 comments
No comments yet.