Enum PollResult

Source
pub enum PollResult<Ordering, Data> {
    Item {
        data: Data,
        ordering: Ordering,
    },
    NoneBefore,
    Terminated,
}
Expand description

The result of a OrderedStream::poll_next_before operation.

Variants§

§

Item

An item with a corresponding ordering token.

Fields

§data: Data
§ordering: Ordering
§

NoneBefore

This stream will not return any items prior to the given point.

§

Terminated

This stream is terminated and should not be polled again.

Implementations§

Source§

impl<D, T> PollResult<T, D>

Source

pub fn into_data(self) -> Option<D>

Extract the data from the result.

Source

pub fn into_tuple(self) -> Option<(T, D)>

Extract the item from the result.

Source

pub fn map_data<R>(self, f: impl FnOnce(D) -> R) -> PollResult<T, R>

Apply a closure to the data.

Source§

impl<T, D, E> PollResult<T, Result<D, E>>

Source

pub fn transpose_result(self) -> Result<PollResult<T, D>, E>

Extract the error of a Result item.

Source

pub fn transpose_result_item(self) -> Result<PollResult<T, D>, (T, E)>

Extract the error and ordering from a Result item.

Trait Implementations§

Source§

impl<Ordering: Debug, Data: Debug> Debug for PollResult<Ordering, Data>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Ordering, Data> Freeze for PollResult<Ordering, Data>
where Data: Freeze, Ordering: Freeze,

§

impl<Ordering, Data> RefUnwindSafe for PollResult<Ordering, Data>
where Data: RefUnwindSafe, Ordering: RefUnwindSafe,

§

impl<Ordering, Data> Send for PollResult<Ordering, Data>
where Data: Send, Ordering: Send,

§

impl<Ordering, Data> Sync for PollResult<Ordering, Data>
where Data: Sync, Ordering: Sync,

§

impl<Ordering, Data> Unpin for PollResult<Ordering, Data>
where Data: Unpin, Ordering: Unpin,

§

impl<Ordering, Data> UnwindSafe for PollResult<Ordering, Data>
where Data: UnwindSafe, Ordering: 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.