Struct Select

#[must_use = "streams do nothing unless polled"]
pub struct Select<St1, St2> { /* private fields */ }

Stream for the [select()] function.

Implementations

impl<St1, St2> Select<St1, St2>

fn get_ref(&self) -> (&St1, &St2)

Acquires a reference to the underlying streams that this combinator is pulling from.

fn get_mut(&mut self) -> (&mut St1, &mut St2)

Acquires a mutable reference to the underlying streams that this combinator is pulling from.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.

fn get_pin_mut(self: Pin<&mut Self>) -> (Pin<&mut St1>, Pin<&mut St2>)

Acquires a pinned mutable reference to the underlying streams that this combinator is pulling from.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.

fn into_inner(self) -> (St1, St2)

Consumes this combinator, returning the underlying streams.

Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.

Trait Implementations

impl<'__pin, St1, St2> Unpin for Select<St1, St2> where PinnedFieldsOf<__Origin<'__pin, St1, St2>>: Unpin,

impl<St1, St2> FusedStream for Select<St1, St2> where St1: Stream, St2: Stream<Item = St1::Item>,

fn is_terminated(&self) -> bool

impl<St1, St2> Stream for Select<St1, St2> where St1: Stream, St2: Stream<Item = St1::Item>,

type Item = <St1 as Stream>::Item;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<St1::Item>>

impl<St1: Debug, St2: Debug> Debug for Select<St1, St2>

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

Auto Trait Implementations

impl<St1, St2> Freeze for Select<St1, St2> where SelectWithStrategy<St1, St2, fn(&mut PollNext) -> PollNext, PollNext>: Freeze,

impl<St1, St2> RefUnwindSafe for Select<St1, St2> where SelectWithStrategy<St1, St2, fn(&mut PollNext) -> PollNext, PollNext>: RefUnwindSafe,

impl<St1, St2> Send for Select<St1, St2> where SelectWithStrategy<St1, St2, fn(&mut PollNext) -> PollNext, PollNext>: Send,

impl<St1, St2> Sync for Select<St1, St2> where SelectWithStrategy<St1, St2, fn(&mut PollNext) -> PollNext, PollNext>: Sync,

impl<St1, St2> UnsafeUnpin for Select<St1, St2> where SelectWithStrategy<St1, St2, fn(&mut PollNext) -> PollNext, PollNext>: UnsafeUnpin,

impl<St1, St2> UnwindSafe for Select<St1, St2> where SelectWithStrategy<St1, St2, fn(&mut PollNext) -> PollNext, PollNext>: UnwindSafe,

Blanket Implementations

impl<S> TryStreamExt for Select<St1, St2> where S: TryStream + ?Sized,

impl<S, T, E> TryStream for Select<St1, St2> where S: Stream<Item = Result<T, E>> + ?Sized,

type Ok = T;
type Error = E;
fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Select<St1, St2> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Select<St1, St2> where T: ?Sized,

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

impl<T> From<T> for Select<St1, St2>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> StreamExt for Select<St1, St2> where T: Stream + ?Sized,

impl<T, U> Into<U> for Select<St1, St2> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for Select<St1, St2> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Select<St1, St2> where U: TryFrom<T>,

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