pub struct Source<T> { /* private fields */ }Implementations§
Source§impl<T: Send + 'static> Source<T>
impl<T: Send + 'static> Source<T>
pub fn from_iter<I: IntoIterator<Item = T> + Send + 'static>(iter: I) -> Self
pub fn single(value: T) -> Self
pub fn empty() -> Self
pub fn repeat(value: T) -> Selfwhere
T: Clone,
pub fn cycle<I: IntoIterator<Item = T> + Clone + Send + 'static>( iter: I, ) -> Self
pub fn from_future<F>(fut: F) -> Self
pub fn unfold<S, F, Fut>(init: S, f: F) -> Self
pub fn tick(initial_delay: Duration, interval: Duration, value: T) -> Selfwhere
T: Clone,
pub fn failed<E>(error: E) -> Source<Result<T, E>>where
E: Send + 'static,
pub fn from_receiver(rx: UnboundedReceiver<T>) -> Self
pub fn map<U, F>(self, f: F) -> Source<U>
Sourcepub fn map_async<U, F, Fut>(self, parallelism: usize, f: F) -> Source<U>
pub fn map_async<U, F, Fut>(self, parallelism: usize, f: F) -> Source<U>
(ordered, bounded parallelism).
pub fn map_async_unordered<U, F, Fut>( self, parallelism: usize, f: F, ) -> Source<U>
Sourcepub fn async_boundary(self, buffer: usize) -> Source<T>
pub fn async_boundary(self, buffer: usize) -> Source<T>
async_boundary(buffer) — explicit async stage that decouples
the upstream and downstream pipelines onto separate Tokio
tasks via a bounded mpsc channel of capacity buffer.
the .async call. Phase 12.3 of
docs/full-port-plan.md.
Useful when an upstream stage is CPU-heavy and you want downstream consumption to overlap with production. Slow downstream applies natural back-pressure once the buffer fills.
pub fn filter<F>(self, f: F) -> Source<T>
pub fn filter_map<U, F>(self, f: F) -> Source<U>
pub fn take(self, n: usize) -> Source<T>
pub fn take_while<F>(self, f: F) -> Source<T>
pub fn skip(self, n: usize) -> Source<T>
pub fn skip_while<F>(self, f: F) -> Source<T>
pub fn scan<Acc, F>(self, init: Acc, f: F) -> Source<Acc>
pub fn intersperse(self, sep: T) -> Source<T>where
T: Clone,
pub fn concat(self, other: Source<T>) -> Source<T>
pub fn prepend(self, other: Source<T>) -> Source<T>
Sourcepub fn initial_delay(self, d: Duration) -> Source<T>
pub fn initial_delay(self, d: Duration) -> Source<T>
Wait d before emitting the first element.
pub fn buffer(self, size: usize, strategy: OverflowStrategy) -> Source<T>
Sourcepub fn wire_tap<F>(self, f: F) -> Source<T>
pub fn wire_tap<F>(self, f: F) -> Source<T>
Observes each element without affecting the stream.
pub fn via<U>(self, flow: Flow<T, U>) -> Source<U>where
U: Send + 'static,
Auto Trait Implementations§
impl<T> Freeze for Source<T>
impl<T> !RefUnwindSafe for Source<T>
impl<T> Send for Source<T>
impl<T> !Sync for Source<T>
impl<T> Unpin for Source<T>
impl<T> UnsafeUnpin for Source<T>
impl<T> !UnwindSafe for Source<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