Struct RepeatWith
#[must_use = "streams do nothing unless polled"]
pub struct RepeatWith<F> { /* private fields */ }
An stream that repeats elements of type A endlessly by
applying the provided closure F: FnMut() -> A.
This struct is created by the [repeat_with()] function.
See its documentation for more.
Trait Implementations
impl<A, F: FnMut() -> A> FusedStream for RepeatWith<F>
fn is_terminated(&self) -> bool
impl<A, F: FnMut() -> A> Stream for RepeatWith<F>
type Item = A;fn poll_next(self: Pin<&mut Self>, &mut Context<'_>) -> Poll<Option<Self::Item>>fn size_hint(&self) -> (usize, Option<usize>)
impl<A, F: FnMut() -> A> Unpin for RepeatWith<F>
impl<F: Clone> Clone for RepeatWith<F>
fn clone(&self) -> RepeatWith<F>
impl<F: Debug> Debug for RepeatWith<F>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<F> Freeze for RepeatWith<F>
where
F: Freeze,
impl<F> RefUnwindSafe for RepeatWith<F>
where
F: RefUnwindSafe,
impl<F> Send for RepeatWith<F>
where
F: Send,
impl<F> Sync for RepeatWith<F>
where
F: Sync,
impl<F> UnsafeUnpin for RepeatWith<F>
where
F: UnsafeUnpin,
impl<F> UnwindSafe for RepeatWith<F>
where
F: UnwindSafe,
Blanket Implementations
impl<S> TryStreamExt for RepeatWith<F>
where
S: TryStream + ?Sized,
impl<S, T, E> TryStream for RepeatWith<F>
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 RepeatWith<F>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for RepeatWith<F>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for RepeatWith<F>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for RepeatWith<F>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for RepeatWith<F>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> StreamExt for RepeatWith<F>
where
T: Stream + ?Sized,
impl<T> ToOwned for RepeatWith<F>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for RepeatWith<F>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for RepeatWith<F>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for RepeatWith<F>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>