Struct WaitQueue
pub struct WaitQueue<I: Copy + Eq + Hash> { /* private fields */ }Expand description
Waiters for one limit’s permits: highest level first, then the levels’ fairness keys in turn (weighted round-robin), then arrival order within a key. Deterministic, so a replicated server can apply it as a state machine. A queue of default-priority waiters only saves as the plain arrival-order list queues always saved as; any other as its levels.
Implementations§
§impl<I: Copy + Eq + Hash> WaitQueue<I>
impl<I: Copy + Eq + Hash> WaitQueue<I>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, id: &I) -> bool
pub fn push(&mut self, id: I, p: &Priority) -> bool
pub fn push(&mut self, id: I, p: &Priority) -> bool
Queues id behind the waiters of its key and level. A waiter that
is already queued keeps its place and priority; returns whether it
was added.
Trait Implementations§
§impl<'de, I> Deserialize<'de> for WaitQueue<I>
impl<'de, I> Deserialize<'de> for WaitQueue<I>
§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<I> Freeze for WaitQueue<I>
impl<I> RefUnwindSafe for WaitQueue<I>where
I: RefUnwindSafe,
impl<I> Send for WaitQueue<I>where
I: Send,
impl<I> Sync for WaitQueue<I>where
I: Sync,
impl<I> Unpin for WaitQueue<I>where
I: Unpin,
impl<I> UnsafeUnpin for WaitQueue<I>
impl<I> UnwindSafe for WaitQueue<I>where
I: UnwindSafe + RefUnwindSafe,
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