pub struct QMap<K: Eq + Hash + Clone, O: Ord + Copy> { /* private fields */ }
Implementations§
Source§impl<K: Eq + Hash + Clone, O: Ord + Copy> QMap<K, O>
impl<K: Eq + Hash + Clone, O: Ord + Copy> QMap<K, O>
pub fn new() -> Self
pub fn len(&self) -> usize
Sourcepub fn upsert(&mut self, key: K, order_by: O)
pub fn upsert(&mut self, key: K, order_by: O)
Inserts key
at order_by
position in the queue. key
gets
overwritten and given new queue position if exists.
Sourcepub fn position(&self, key: &K) -> Option<&O>
pub fn position(&self, key: &K) -> Option<&O>
Tells the position of key
in the queue. Returns None
if key
is
not in store.
pub fn front(&self) -> Option<(&O, &K)>
pub fn back(&self) -> Option<(&O, &K)>
pub fn pop_front(&mut self) -> Option<(O, K)>
pub fn pop_back(&mut self) -> Option<(O, K)>
Sourcepub fn pop_front_until(&mut self, until: &O) -> Vec<(O, K)>
pub fn pop_front_until(&mut self, until: &O) -> Vec<(O, K)>
Pops elements from the front of the queue whose position is less than
(inclusive) until
. Less than means further front.
Sourcepub fn pop_back_until(&mut self, until: &O) -> Vec<(O, K)>
pub fn pop_back_until(&mut self, until: &O) -> Vec<(O, K)>
Pops elements from the back of the queue whose position is greater than
(inclusive) until
. Greater than means further back.
pub fn push_front( &mut self, key: K, order_by: O, ) -> Result<(), InvalidOrder<(O, K)>>
pub fn push_back( &mut self, key: K, order_by: O, ) -> Result<(), InvalidOrder<(O, K)>>
Auto Trait Implementations§
impl<K, O> Freeze for QMap<K, O>
impl<K, O> RefUnwindSafe for QMap<K, O>where
K: RefUnwindSafe,
O: RefUnwindSafe,
impl<K, O> Send for QMap<K, O>
impl<K, O> Sync for QMap<K, O>
impl<K, O> Unpin for QMap<K, O>
impl<K, O> UnwindSafe for QMap<K, O>where
K: UnwindSafe,
O: 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
Mutably borrows from an owned value. Read more