Unfold

Struct Unfold 

Source
pub struct Unfold<T, F, E> { /* private fields */ }

Trait Implementations§

Source§

impl<T, F, E, Item> Effective for Unfold<T, F, E>
where F: FnMut(T) -> E, E: Effective<Item = Option<(Item, T)>, Produces = Single>,

Source§

type Item = Item

What item does this effective type produce
Source§

type Failure = <E as Effective>::Failure

What non-success types can this effective produce
Source§

type Async = <E as Effective>::Async

Models whether this effective type can pause or will block
Source§

type Produces = Multiple

Models whether this effective type can produce multiple values
Source§

fn poll_effect( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> EffectResult<Self::Item, Self::Failure, Self::Produces, Self::Async>

Attempt to pull out the next value of this effective. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
Source§

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

Auto Trait Implementations§

§

impl<T, F, E> Freeze for Unfold<T, F, E>
where F: Freeze, E: Freeze, T: Freeze,

§

impl<T, F, E> RefUnwindSafe for Unfold<T, F, E>

§

impl<T, F, E> Send for Unfold<T, F, E>
where F: Send, E: Send, T: Send,

§

impl<T, F, E> Sync for Unfold<T, F, E>
where F: Sync, E: Sync, T: Sync,

§

impl<T, F, E> UnwindSafe for Unfold<T, F, E>
where F: UnwindSafe, E: UnwindSafe, T: 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<E> EffectiveExt for E
where E: Effective,

Source§

fn flat_map<R, F>(self, f: F) -> Flatten<Map<Self, F>>
where Self: Sized, F: FnMut(Self::Item) -> R, R: Effective, Self::Produces: ProducesMultipleWith<<R as Effective>::Produces>, Self::Async: IsAsyncWith<<R as Effective>::Async>, Self::Failure: HasFailureWith<<R as Effective>::Failure>,

Apply the function over the items, returning a new effective, Flattening the result into a single effective.
Source§

fn flatten_fallible( self, ) -> Flatten<Map<Self, fn(Self::Item) -> FromFallible<Self::Item>>>

If the Item of this effective is fallible, it pulls that flattens into the effective. Read more
Source§

fn flatten_future( self, ) -> Flatten<Map<Self, fn(Self::Item) -> FromFuture<Self::Item>>>

If the Item of this effective is a future, it pulls that future into the effective.
Source§

fn flatten_iterator( self, ) -> Flatten<Map<Self, fn(Self::Item) -> FromIterator<Self::Item>>>

If the Item of this effective is an iterator, it pulls that iterator into the effective.
Source§

fn map<R, F>(self, f: F) -> Map<Self, F>
where Self: Sized, F: FnMut(Self::Item) -> R,

Map the items in the effective Read more
Source§

fn flatten(self) -> Flatten<Self>
where Self: Sized, Self::Item: Effective, Self::Produces: ProducesMultipleWith<<Self::Item as Effective>::Produces>, Self::Async: IsAsyncWith<<Self::Item as Effective>::Async>, Self::Failure: HasFailureWith<<Self::Item as Effective>::Failure>,

If this effective item is itself an effective, flatten those items into a single effective.
Source§

fn collect<C>(self) -> Collect<Self, C>
where Self: Sized + Effective<Produces = Multiple>, C: Default + Extend<Self::Item>,

Collect the items from this iterator into a collection. Read more
Source§

fn block_on<R>(self, executor: R) -> Block<Self, R>
where Self: Sized + Effective<Async = Async>, R: Executor,

Block on the async effective Read more
Source§

fn unwrap(self) -> Unwrap<Self>
where Self: Sized, Self::Failure: Debug,

Panic on the fallible effective Read more
Source§

fn get(self) -> Self::Item
where Self: Sized + Effective<Produces = Single, Failure = Infallible, Async = Blocking>,

Extract the value if there are no more effects possible
Source§

fn try_get<R, F>(self) -> R
where Self: Sized + Effective<Produces = Single, Async = Blocking, Failure = Failure<F>>, R: Fallible<Continue = Self::Item, Break = F>,

Extract the value or failure
Source§

fn shim(self) -> Shim<Self>
where Self: Sized,

Return a shim that implements either Future, Stream or Iterator
Source§

fn try_shim(self) -> TryShim<Self>
where Self: Sized,

Return a shim that implements either TryFuture, TryStream or Iterator
Source§

fn fold<F, B, C>(self, init: B, func: F) -> Fold<Self, F, B, C>
where Self: Sized + Effective<Produces = Multiple>, F: FnMut(B, Self::Item) -> C, C: Effective<Item = B, Produces = Single>,

High level fold function. Takes all the items in the effective and applies the func to it, with a running accumulator. Returns the final accumulator value. Read more
Source§

fn for_each<F, C>(self, func: F) -> ForEach<Self, F, C>
where Self: Sized + Effective<Produces = Multiple>, F: FnMut(Self::Item) -> C, C: Effective<Item = ()>,

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.