pub struct BoundedIntakeQueue<const CAP: usize> { /* private fields */ }Expand description
Bounded FIFO intake queue for the request scheduler.
Implementations§
Source§impl<const CAP: usize> BoundedIntakeQueue<CAP>
impl<const CAP: usize> BoundedIntakeQueue<CAP>
Sourcepub fn enqueue(&mut self, request: IntakeRequest) -> Result<(), IntakeError>
pub fn enqueue(&mut self, request: IntakeRequest) -> Result<(), IntakeError>
Enqueue a new request. Fails closed with QueueFull if capacity reached.
Sourcepub fn pop_next_runnable(&mut self) -> Option<IntakeRequest>
pub fn pop_next_runnable(&mut self) -> Option<IntakeRequest>
Pop the next non-cancelled request ready for admission.
Sourcepub fn cancel(&mut self, request_id: u64) -> Result<IntakeState, IntakeError>
pub fn cancel(&mut self, request_id: u64) -> Result<IntakeState, IntakeError>
Cancel a request by ID. Returns the prior state if successfully cancelled.
Sourcepub fn find(&self, request_id: u64) -> Option<&IntakeRequest>
pub fn find(&self, request_id: u64) -> Option<&IntakeRequest>
Find an intake request by ID.
Trait Implementations§
Source§impl<const CAP: usize> Debug for BoundedIntakeQueue<CAP>
impl<const CAP: usize> Debug for BoundedIntakeQueue<CAP>
Auto Trait Implementations§
impl<const CAP: usize> Freeze for BoundedIntakeQueue<CAP>
impl<const CAP: usize> RefUnwindSafe for BoundedIntakeQueue<CAP>
impl<const CAP: usize> Send for BoundedIntakeQueue<CAP>
impl<const CAP: usize> Sync for BoundedIntakeQueue<CAP>
impl<const CAP: usize> Unpin for BoundedIntakeQueue<CAP>
impl<const CAP: usize> UnsafeUnpin for BoundedIntakeQueue<CAP>
impl<const CAP: usize> UnwindSafe for BoundedIntakeQueue<CAP>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.