Feature gate: #![feature(deque_extend_front)]
This is a tracking issue for 5 new methods on VecDeque similar to ones already on Vec or their counterparts that push to the front instead of back.
ACP: rust-lang/libs-team#658
Public API
// alloc::collections::vec_deque
impl<T> VecDeque<T> {
// Preserves order of elements.
pub fn prepend<I>(&mut self, other: I)
where
I: IntoIterator<Item = T>,
I::Iter: DoubleEndedIterator
{
self.extend_front(other.into_iter().rev())
}
// Reverses order of elements.
pub fn extend_front<I>(&mut self, other: I)
where
I: IntoIterator<Item = T>;
pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter, A>
where
R: RangeBounds<usize>,
I: IntoIterator<Item = T>;
}
impl<T: Clone> VecDeque<T> {
pub fn extend_from_within<R>(&mut self, src: R)
where
R: RangeBounds<usize>;
// Preserves order of elements.
pub fn prepend_from_within<R>(&mut self, src: R)
where
R: RangeBounds<usize>;
}
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
Unresolved Questions
Feature gate:
#![feature(deque_extend_front)]This is a tracking issue for 5 new methods on
VecDequesimilar to ones already onVecor their counterparts that push to the front instead of back.ACP: rust-lang/libs-team#658
Public API
Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)deque1.prepend(deque2.drain(range)): Add specialization fordeque1.prepend(deque2.drain(range))(VecDeque::prepend and extend_front) #150595Vec::extendandVecDeque::extend_frontwork for vec::IntoIter with anyAllocator, not justGlobal#150597Unresolved Questions
VecDeque::splicein the less optimal conditions (see "This is optimal if:" in the doc), see https://github.com/rust-lang/rust/pull/147247/files#r2507005344Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩