pub enum PushStep<CanPend>where
CanPend: Toggle,{
Done,
Pending(CanPend),
}Expand description
The result of pushing an item into a Push.
PushStep represents the two possible outcomes when pushing into a pipeline:
Done: The item was successfully consumed.Pending(can_pend): The push could not accept the item yet (async backpressure).
The CanPend type parameter uses Toggle to statically encode whether pending
is possible. When CanPend = No, the Pending variant cannot be constructed,
and the push is guaranteed to always accept items immediately.
Variants§
Done
The item was successfully consumed.
Pending(CanPend)
The push is not ready yet (only possible when CanPend = Yes).
Implementations§
Source§impl<CanPend> PushStep<CanPend>where
CanPend: Toggle,
impl<CanPend> PushStep<CanPend>where
CanPend: Toggle,
Sourcepub const fn is_done(&self) -> bool
pub const fn is_done(&self) -> bool
Returns true if the step is PushStep::Done.
Sourcepub const fn is_pending(&self) -> bool
pub const fn is_pending(&self) -> bool
Returns true if the step is PushStep::Pending.
Sourcepub fn try_convert_into<NewPend>(self) -> Option<PushStep<NewPend>>where
NewPend: Toggle,
pub fn try_convert_into<NewPend>(self) -> Option<PushStep<NewPend>>where
NewPend: Toggle,
Tries to convert the CanPend type parameter, returning None if the conversion is invalid.
Sourcepub fn convert_into<NewPend>(self) -> PushStep<NewPend>where
NewPend: Toggle,
pub fn convert_into<NewPend>(self) -> PushStep<NewPend>where
NewPend: Toggle,
Converts the CanPend type parameter, panicking if the conversion is invalid.
Trait Implementations§
Source§impl<CanPend> Ord for PushStep<CanPend>
impl<CanPend> Ord for PushStep<CanPend>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<CanPend> PartialOrd for PushStep<CanPend>where
CanPend: Toggle + PartialOrd,
impl<CanPend> PartialOrd for PushStep<CanPend>where
CanPend: Toggle + PartialOrd,
impl<CanPend> Copy for PushStep<CanPend>
impl<CanPend> Eq for PushStep<CanPend>
impl<CanPend> StructuralPartialEq for PushStep<CanPend>where
CanPend: Toggle,
Auto Trait Implementations§
impl<CanPend> Freeze for PushStep<CanPend>where
CanPend: Freeze,
impl<CanPend> RefUnwindSafe for PushStep<CanPend>where
CanPend: RefUnwindSafe,
impl<CanPend> Send for PushStep<CanPend>where
CanPend: Send,
impl<CanPend> Sync for PushStep<CanPend>where
CanPend: Sync,
impl<CanPend> Unpin for PushStep<CanPend>where
CanPend: Unpin,
impl<CanPend> UnsafeUnpin for PushStep<CanPend>where
CanPend: UnsafeUnpin,
impl<CanPend> UnwindSafe for PushStep<CanPend>where
CanPend: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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