Struct Unfold

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

Stream for the unfold function.

Trait Implementations

impl<'__pin, T, F, Fut> Unpin for Unfold<T, F, Fut> where PinnedFieldsOf<__Origin<'__pin, T, F, Fut>>: Unpin,

impl<T, F, Fut> Debug for Unfold<T, F, Fut> where T: Debug, Fut: Debug,

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

impl<T, F, Fut, Item> FusedStream for Unfold<T, F, Fut> where F: FnMut(T) -> Fut, Fut: Future<Output = Option<(Item, T)>>,

fn is_terminated(&self) -> bool

impl<T, F, Fut, Item> Stream for Unfold<T, F, Fut> where F: FnMut(T) -> Fut, Fut: Future<Output = Option<(Item, T)>>,

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

Auto Trait Implementations

impl<T, F, Fut> Freeze for Unfold<T, F, Fut> where F: Freeze, UnfoldState<T, Fut>: Freeze,

impl<T, F, Fut> RefUnwindSafe for Unfold<T, F, Fut> where F: RefUnwindSafe, UnfoldState<T, Fut>: RefUnwindSafe,

impl<T, F, Fut> Send for Unfold<T, F, Fut> where F: Send, UnfoldState<T, Fut>: Send,

impl<T, F, Fut> Sync for Unfold<T, F, Fut> where F: Sync, UnfoldState<T, Fut>: Sync,

impl<T, F, Fut> UnsafeUnpin for Unfold<T, F, Fut> where F: UnsafeUnpin, UnfoldState<T, Fut>: UnsafeUnpin,

impl<T, F, Fut> UnwindSafe for Unfold<T, F, Fut> where F: UnwindSafe, UnfoldState<T, Fut>: UnwindSafe,

Blanket Implementations

impl<S> TryStreamExt for Unfold<T, F, Fut> where S: TryStream + ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Unfold<T, F, Fut>

fn from(t: T) -> T

Returns the argument unchanged.

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

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

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

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

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