pub struct Repeat<F>(/* private fields */);Expand description
Applies a function to each input, yielding results indefinitely.
Never completes on its own - will continue processing until externally stopped.
Trait Implementations§
Source§impl<I, O, F> Sans<I, O> for Repeat<F>where
F: FnMut(I) -> O,
impl<I, O, F> Sans<I, O> for Repeat<F>where
F: FnMut(I) -> O,
Source§fn next(&mut self, input: I) -> Step<O, Self::Return>
fn next(&mut self, input: I) -> Step<O, Self::Return>
Process input, returning
Yield to continue or Return to complete.Source§fn and_then<T, F>(self, f: F) -> AndThen<Self, T::Next, F>
fn and_then<T, F>(self, f: F) -> AndThen<Self, T::Next, F>
Chain with a coroutine created from this coroutine’s return value. Read more
fn boxed(self) -> Box<dyn Sans<I, O, Return = Self::Return>>where
Self: Sized + 'static,
Source§fn chain_once<F>(self, f: F) -> Chain<Self, Once<F>>
fn chain_once<F>(self, f: F) -> Chain<Self, Once<F>>
Chain with a function that executes once.
Source§fn chain_repeat<F>(self, f: F) -> Chain<Self, Repeat<F>>
fn chain_repeat<F>(self, f: F) -> Chain<Self, Repeat<F>>
Chain with a function that repeats indefinitely.
Source§fn map_input<I2, F>(self, f: F) -> MapInput<Self, F>
fn map_input<I2, F>(self, f: F) -> MapInput<Self, F>
Transform inputs before they reach this coroutine.
Source§fn map_yield<O2, F>(self, f: F) -> MapYield<Self, F, I, O>
fn map_yield<O2, F>(self, f: F) -> MapYield<Self, F, I, O>
Transform yielded values before returning them.
Source§fn map_return<D2, F>(self, f: F) -> MapReturn<Self, F>
fn map_return<D2, F>(self, f: F) -> MapReturn<Self, F>
Transform the final result when completing.
Auto Trait Implementations§
impl<F> Freeze for Repeat<F>where
F: Freeze,
impl<F> RefUnwindSafe for Repeat<F>where
F: RefUnwindSafe,
impl<F> Send for Repeat<F>where
F: Send,
impl<F> Sync for Repeat<F>where
F: Sync,
impl<F> Unpin for Repeat<F>where
F: Unpin,
impl<F> UnsafeUnpin for Repeat<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Repeat<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<I, O, S> TrySans<I, O> for Swhere
S: Sans<I, O>,
impl<I, O, S> TrySans<I, O> for Swhere
S: Sans<I, O>,
Source§fn ok_map<P, E, T, F>(self, f: F) -> OkMap<Self, T::Next, F>
fn ok_map<P, E, T, F>(self, f: F) -> OkMap<Self, T::Next, F>
Maps
Ok return values through a function that produces an InitSans.Source§fn ok_and_then<P, Q, E, T, F>(self, f: F) -> OkAndThen<Self, T::Next, F>
fn ok_and_then<P, Q, E, T, F>(self, f: F) -> OkAndThen<Self, T::Next, F>
Chains through a function that produces an
InitSans with a Result return type.