pub struct RequestQueue { /* private fields */ }Implementations§
Source§impl RequestQueue
impl RequestQueue
pub fn new(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
Sourcepub fn push(&mut self, req: PriorityRequest) -> Result<(), PriorityRequest>
pub fn push(&mut self, req: PriorityRequest) -> Result<(), PriorityRequest>
Enqueue. Caller must already have classified the priority.
Returns Err carrying the request if full. The request is
boxed so the Result doesn’t carry a fat Err variant on the
happy path (queue mailboxes pass this around frequently).
pub fn pop(&mut self) -> Option<PriorityRequest>
Auto Trait Implementations§
impl Freeze for RequestQueue
impl RefUnwindSafe for RequestQueue
impl Send for RequestQueue
impl Sync for RequestQueue
impl Unpin for RequestQueue
impl UnsafeUnpin for RequestQueue
impl UnwindSafe for RequestQueue
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