[][src]Trait futures_option::OptionExt

pub trait OptionExt<T>: Sized {
    fn next(&mut self) -> Next<T>
    where
        T: Stream + Unpin
;
fn select_next_some(&mut self) -> SelectNextSome<T>
    where
        T: Stream + Unpin
;
fn current(&mut self) -> Current<T>
    where
        T: Future + Unpin
; }

Extension methods for Option of Streams or Futures.

Required methods

Important traits for Next<'a, T>
fn next(&mut self) -> Next<T> where
    T: Stream + Unpin

Convert Option into a Future that resolves to the next item in the Stream.

If the Option is None, the returned future also resolves to None.

Important traits for SelectNextSome<'a, T>
fn select_next_some(&mut self) -> SelectNextSome<T> where
    T: Stream + Unpin

Returns a Future that resolves when the next item in this stream is ready.

If the Option is None, the returned future will always be pending.

Important traits for Current<'a, T>
fn current(&mut self) -> Current<T> where
    T: Future + Unpin

Convert Option into a Future that resolves to the same value as the stored Future.

If the Option is None, the returned future also resolves to None.

Loading content...

Implementations on Foreign Types

impl<T> OptionExt<T> for Option<T>[src]

Loading content...

Implementors

Loading content...