pub struct StableIndexVecDeque<T, I>where
I: Offset,{ /* private fields */ }Expand description
Double-ended queue with stable indices
Implementations§
Source§impl<T, I> Deque<T, I>where
I: Offset,
impl<T, I> Deque<T, I>where
I: Offset,
pub fn new() -> Deque<T, I>
Sourcepub fn with_capacity(cap: usize) -> Deque<T, I>
pub fn with_capacity(cap: usize) -> Deque<T, I>
Like VecDeque::with_capacity
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn front(&self) -> Option<&T>
pub fn back(&self) -> Option<&T>
pub fn front_mut(&mut self) -> Option<&mut T>
pub fn back_mut(&mut self) -> Option<&mut T>
Sourcepub fn get(&self, i: I) -> Option<&T>
pub fn get(&self, i: I) -> Option<&T>
Returns the element with index i, if it is still in the deque.
pub fn get_mut(&mut self, i: I) -> Option<&mut T>
Sourcepub fn push_front(&mut self, e: T) -> I
pub fn push_front(&mut self, e: T) -> I
Panics on index overflow.
Sourcepub fn swap_remove_front(&mut self, i: I) -> Option<T>
pub fn swap_remove_front(&mut self, i: I) -> Option<T>
Removes the element with index i, by replacing it with the
eleement from the front. Invalidates the index of the front
element element (now i refers to that) but leaves other
indices valid. Panics on index overflow.
Sourcepub fn swap_remove_back(&mut self, i: I) -> Option<T>
pub fn swap_remove_back(&mut self, i: I) -> Option<T>
Removes the element with index i, by replacing it with the
eleement from the back. Invalidates the index of the back
element (now i refers to that), but leaves other indices
valid. Panics on index overflow.
Sourcepub fn front_index(&self) -> I
pub fn front_index(&self) -> I
The index of the first item the deque. If the queue is
empty, this is the same as end_index.
Sourcepub fn end_index(&self) -> I
pub fn end_index(&self) -> I
The index just after the end of the qeue. I.e., the index that
would be assigned to a new element added with push_back.
Panics on index overflow.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, T, I> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T, I> ⓘ
Returns a (front-to-back) iterator which returns mutable references.
Sourcepub fn counter_mut(&mut self) -> &mut I
pub fn counter_mut(&mut self) -> &mut I
Modifying this invalidates all indices.
Sourcepub fn inner_mut(&mut self) -> &mut VecDeque<T>
pub fn inner_mut(&mut self) -> &mut VecDeque<T>
Mutable access to the VecDeque inside this Dequeu.
Adding/removing elements at the front of of the VecDeque
invalidates all indices.
pub fn into_parts(self) -> (I, VecDeque<T>)
pub fn from_parts(advanced: I, v: VecDeque<T>) -> Deque<T, I>
pub fn as_parts(&self) -> (&I, &VecDeque<T>)
Sourcepub fn as_mut_parts(&mut self) -> (&mut I, &mut VecDeque<T>)
pub fn as_mut_parts(&mut self) -> (&mut I, &mut VecDeque<T>)
Modifying the parts inconsistently will invalidate indices.
Trait Implementations§
Source§impl<T, I> Extend<T> for Deque<T, I>where
I: Offset,
impl<T, I> Extend<T> for Deque<T, I>where
I: Offset,
Source§fn extend<X>(&mut self, iter: X)where
X: IntoIterator<Item = T>,
fn extend<X>(&mut self, iter: X)where
X: IntoIterator<Item = T>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<T, I> FromIterator<T> for Deque<T, I>where
I: Offset,
impl<T, I> FromIterator<T> for Deque<T, I>where
I: Offset,
Source§impl<'v, T, I> IntoIterator for &'v Deque<T, I>where
I: Offset,
impl<'v, T, I> IntoIterator for &'v Deque<T, I>where
I: Offset,
Source§impl<'v, T, I> IntoIterator for &'v mut Deque<T, I>where
I: Offset,
impl<'v, T, I> IntoIterator for &'v mut Deque<T, I>where
I: Offset,
Source§impl<T, I> IntoIterator for Deque<T, I>where
I: Offset,
impl<T, I> IntoIterator for Deque<T, I>where
I: Offset,
Source§impl<T, I> PartialEq for Deque<T, I>
impl<T, I> PartialEq for Deque<T, I>
impl<T, I> Eq for Deque<T, I>
impl<T, I> StructuralPartialEq for Deque<T, I>where
I: Offset,
Auto Trait Implementations§
impl<T, I> Freeze for Deque<T, I>where
I: Freeze,
impl<T, I> RefUnwindSafe for Deque<T, I>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> Send for Deque<T, I>
impl<T, I> Sync for Deque<T, I>
impl<T, I> Unpin for Deque<T, I>
impl<T, I> UnsafeUnpin for Deque<T, I>where
I: UnsafeUnpin,
impl<T, I> UnwindSafe for Deque<T, I>where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A> DynCastExt for A
impl<A> DynCastExt for A
Source§fn dyn_cast<T>(
self,
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source>where
A: DynCastExtHelper<T>,
T: ?Sized,
fn dyn_cast<T>(
self,
) -> Result<<A as DynCastExtHelper<T>>::Target, <A as DynCastExtHelper<T>>::Source>where
A: DynCastExtHelper<T>,
T: ?Sized,
Source§fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
fn dyn_upcast<T>(self) -> <A as DynCastExtAdvHelper<T, T>>::Target
Source§fn dyn_cast_adv<F, T>(
self,
) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
fn dyn_cast_adv<F, T>( self, ) -> Result<<A as DynCastExtAdvHelper<F, T>>::Target, <A as DynCastExtAdvHelper<F, T>>::Source>
Source§fn dyn_cast_with_config<C>(
self,
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source>where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
fn dyn_cast_with_config<C>(
self,
) -> Result<<A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Target, <A as DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>>::Source>where
C: DynCastConfig,
A: DynCastExtAdvHelper<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more