core::collections::deque
本页内容
API 参考只有英文版,由标准库源代码中的英文文档注释生成。
Deque<T>, a growable ring buffer
with O(1) push and pop at both ends. meta holds [head, len, cap];
a vacated slot is overwritten with a zeroed T so the deque does not
keep a popped value alive.
Structs
DequeSource
pub struct Deque<T>A growable ring buffer with O(1) push and pop at both ends.
An empty deque.
Room for
capitems before the first growth.The number of items.
truewhen the deque holds no item.The items the ring holds before it grows.
Add
xat the back.Add
xat the front.Remove and return the front item.
Remove and return the back item.
Element
ifrom the front, ornoneout of bounds.The front item.
The back item.
Drop every item.
The items, front to back, lazily.
Trait implementations 12
impl<T> !Sync for Deque<T>impl<T> IntoIterator for Deque<T>impl<T> Default for Deque<T>impl<T: Clone> Clone for Deque<T>impl<T> FromIterator<T> for Deque<T>impl<T> AddAssign<T> for Deque<T>impl<T: PartialEq> PartialEq for Deque<T>impl<T: Eq> Eq for Deque<T>impl<T> Index<usize> for Deque<T>impl<T> IndexSet<usize, T> for Deque<T>impl<T: Debug> Debug for Deque<T>impl<T> Transfer for Deque<T>
DequeIterSource
pub struct DequeIter<T>Front to back.