Skip to main content

PriorityQueueOutcome

Enum PriorityQueueOutcome 

Source
pub enum PriorityQueueOutcome<T, P> {
    Accepted {
        depth: usize,
    },
    Rejected {
        value: T,
        priority: P,
        reason: PriorityQueueRejection,
    },
    Released {
        remaining: usize,
    },
    Empty,
}
Expand description

Factual result of one priority-queue operation.

Variants§

§

Accepted

Value was accepted.

Fields

§depth: usize

Queue depth after admission.

§

Rejected

Value was not accepted; ownership is returned.

Fields

§value: T

Unaccepted value.

§priority: P

Exact priority from the rejected offer.

§reason: PriorityQueueRejection

Exhaustive reason.

§

Released

Highest-priority oldest-tie value was released.

Fields

§remaining: usize

Queue depth after release.

§

Empty

No retained value was available.

Trait Implementations§

Source§

impl<T: Debug, P: Debug> Debug for PriorityQueueOutcome<T, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: PartialEq, P: PartialEq> PartialEq for PriorityQueueOutcome<T, P>

Source§

fn eq(&self, other: &PriorityQueueOutcome<T, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Eq, P: Eq> Eq for PriorityQueueOutcome<T, P>

Source§

impl<T, P> StructuralPartialEq for PriorityQueueOutcome<T, P>

Auto Trait Implementations§

§

impl<T, P> Freeze for PriorityQueueOutcome<T, P>
where T: Freeze, P: Freeze,

§

impl<T, P> RefUnwindSafe for PriorityQueueOutcome<T, P>

§

impl<T, P> Send for PriorityQueueOutcome<T, P>
where T: Send, P: Send,

§

impl<T, P> Sync for PriorityQueueOutcome<T, P>
where T: Sync, P: Sync,

§

impl<T, P> Unpin for PriorityQueueOutcome<T, P>
where T: Unpin, P: Unpin,

§

impl<T, P> UnsafeUnpin for PriorityQueueOutcome<T, P>
where T: UnsafeUnpin, P: UnsafeUnpin,

§

impl<T, P> UnwindSafe for PriorityQueueOutcome<T, P>
where T: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.