pub struct LazyStream<T> { /* private fields */ }Expand description
A purely Rust-level lazy stream (for algorithm testing).
Unlike the OxiLean expression-level Stream, this is a Rust iterator wrapper.
Implementations§
Source§impl<T> LazyStream<T>
impl<T> LazyStream<T>
Sourcepub fn from_fn(gen: impl FnMut() -> Option<T> + 'static) -> Self
pub fn from_fn(gen: impl FnMut() -> Option<T> + 'static) -> Self
Create a stream from a generator function.
Sourcepub fn constant(val: T) -> Selfwhere
T: Clone + 'static,
pub fn constant(val: T) -> Selfwhere
T: Clone + 'static,
Create an infinite stream that always yields the same value.
Auto Trait Implementations§
impl<T> Freeze for LazyStream<T>
impl<T> !RefUnwindSafe for LazyStream<T>
impl<T> !Send for LazyStream<T>
impl<T> !Sync for LazyStream<T>
impl<T> Unpin for LazyStream<T>
impl<T> UnsafeUnpin for LazyStream<T>
impl<T> !UnwindSafe for LazyStream<T>
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