Skip to main content

Flow

Struct Flow 

Source
pub struct Flow<In, Out> { /* private fields */ }

Implementations§

Source§

impl<T: Send + 'static> Flow<T, T>

Source

pub fn identity() -> Self

Source§

impl<In: Send + 'static, Out: Send + 'static> Flow<In, Out>

Source

pub fn from_fn<F>(f: F) -> Self
where F: FnMut(In) -> Out + Send + 'static,

Pure synchronous mapping./ Select.

Source

pub fn map_async<F, Fut>(parallelism: usize, f: F) -> Self
where F: FnMut(In) -> Fut + Send + 'static, Fut: Future<Output = Out> + Send + 'static,

Asynchronous mapping with ordered bounded parallelism.

Source

pub fn via<Out2: Send + 'static>(self, next: Flow<Out, Out2>) -> Flow<In, Out2>

Chain another flow after this one.

Source

pub fn then<Out2, F>(self, g: F) -> Flow<In, Out2>
where Out2: Send + 'static, F: FnMut(Out) -> Out2 + Send + 'static,

Compose with a post-processing closure./ Select.

Source§

impl<In: Send + 'static> Flow<In, In>

Source

pub fn filter<F>(f: F) -> Self
where F: FnMut(&In) -> bool + Send + 'static,

Source

pub fn take(n: usize) -> Self

Source

pub fn skip(n: usize) -> Self

Source

pub fn throttle(interval: Duration) -> Self

Source§

impl<In: Send + 'static, Out: Send + 'static> Flow<In, Out>

Source

pub fn flat_map_concat<F, S, U>(f: F) -> Flow<In, U>
where F: FnMut(In) -> S + Send + 'static, S: IntoIterator<Item = U> + Send + 'static, S::IntoIter: Send + 'static, U: Send + 'static, In: 'static,

/ flatMapConcat.

Auto Trait Implementations§

§

impl<In, Out> Freeze for Flow<In, Out>

§

impl<In, Out> !RefUnwindSafe for Flow<In, Out>

§

impl<In, Out> Send for Flow<In, Out>

§

impl<In, Out> !Sync for Flow<In, Out>

§

impl<In, Out> Unpin for Flow<In, Out>

§

impl<In, Out> UnsafeUnpin for Flow<In, Out>

§

impl<In, Out> !UnwindSafe for Flow<In, Out>

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<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.