Struct Once

#[must_use = "streams do nothing unless polled"]
pub struct Once<Fut> { /* private fields */ }

A stream which emits single element and then EOF.

Trait Implementations

impl<'__pin, Fut> Unpin for Once<Fut> where PinnedFieldsOf<__Origin<'__pin, Fut>>: Unpin,

impl<Fut: Debug> Debug for Once<Fut>

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

impl<Fut: Future> FusedStream for Once<Fut>

fn is_terminated(&self) -> bool

impl<Fut: Future> Stream for Once<Fut>

type Item = <Fut as Future>::Output;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
fn size_hint(&self) -> (usize, Option<usize>)

Auto Trait Implementations

impl<Fut> Freeze for Once<Fut> where Option<Fut>: Freeze,

impl<Fut> RefUnwindSafe for Once<Fut> where Option<Fut>: RefUnwindSafe,

impl<Fut> Send for Once<Fut> where Option<Fut>: Send,

impl<Fut> Sync for Once<Fut> where Option<Fut>: Sync,

impl<Fut> UnsafeUnpin for Once<Fut> where Option<Fut>: UnsafeUnpin,

impl<Fut> UnwindSafe for Once<Fut> where Option<Fut>: UnwindSafe,

Blanket Implementations

impl<S> TryStreamExt for Once<Fut> where S: TryStream + ?Sized,

impl<S, T, E> TryStream for Once<Fut> 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 Once<Fut> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Once<Fut>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> StreamExt for Once<Fut> where T: Stream + ?Sized,

impl<T, U> Into<U> for Once<Fut> 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 Once<Fut> where U: Into<T>,

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

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

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