Struct otter_api_tests::shapelib::StableIndexVecDeque[]

pub struct StableIndexVecDeque<T, I> where
    I: Offset
{ /* fields omitted */ }

Double-ended queue with stable indices

Implementations

impl<T, I> Deque<T, I> where
    I: Offset

pub fn new() -> 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>

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>

pub fn push_front(&mut self, e: T) -> I

Panics on index overflow.

pub fn push_back(&mut self, e: T) -> I

Panics on index overflow.

pub fn pop_front(&mut self) -> Option<T>

Panics on index overflow.

pub fn pop_back(&mut self) -> Option<T>

Panics on index overflow.

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.

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.

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.

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.

pub fn counter(&self) -> &I

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;

I is how many more times pop_front has been called than push_back.

pub fn counter_mut(&mut self) -> &mut I

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;

Modifying this invalidates all indices.

pub fn inner(&self) -> &VecDeque<T>

Allos access to the VecDeque inside this Deque

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>)

pub fn as_mut_parts(&mut self) -> (&mut I, &mut VecDeque<T>)

Modifying the parts inconsistently will invalidate indices.

Trait Implementations

impl<T, I> Clone for Deque<T, I> where
    T: Clone,
    I: Clone + Offset

impl<T, I> Debug for Deque<T, I> where
    T: Debug,
    I: Debug + Offset

impl<T, I> Default for Deque<T, I> where
    I: Offset

impl<T, I> Hash for Deque<T, I> where
    T: Hash,
    I: Hash + Offset

impl<T, I> Index<I> for Deque<T, I> where
    I: Offset

type Output = T

The returned type after indexing.

impl<T, I> IndexMut<I> for Deque<T, I> where
    I: Offset

impl<'v, T, I> IntoIterator for &'v Deque<T, I> where
    I: Offset

type Item = (I, &'v T)

The type of the elements being iterated over.

type IntoIter = Iter<'v, T, I>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<T, I> RefUnwindSafe for Deque<T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, I> Send for Deque<T, I> where
    I: Send,
    T: Send

impl<T, I> Sync for Deque<T, I> where
    I: Sync,
    T: Sync

impl<T, I> Unpin for Deque<T, I> where
    I: Unpin,
    T: Unpin

impl<T, I> UnwindSafe for Deque<T, I> where
    I: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<A> DynCastExt for A

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,