ConcurrentEach

Struct ConcurrentEach 

Source
pub struct ConcurrentEach<I: Send + 'static, S: Service<I>> { /* private fields */ }

Implementations§

Source§

impl<I, S> ConcurrentEach<I, S>
where I: Send, S: Service<I> + Send, S::Out: Send,

Source

pub fn new(service: S, limit: usize) -> Self

Trait Implementations§

Source§

impl<I, R, E, S> Service<I> for ConcurrentEach<I, S>
where I: Send, R: Send + 'static, E: Send + 'static, S: Service<I, Out = Result<R, E>> + Clone + Send + 'static,

Source§

type Out = Result<ConcurrentRx<<S as Service<I>>::Out>, E>

Source§

fn handle( &mut self, input: I, cx: &Context, ) -> impl Stream<Item = Self::Out> + Send

Source§

fn handle_stream( &mut self, input: impl Stream<Item = In> + Send, cx: &Context, ) -> impl Stream<Item = Self::Out> + Send
where In: Send, Self: Send, Self::Out: Send,

Source§

fn finalize(&mut self, _cx: &Context) -> impl Future<Output = ()>
where Self: Sized,

Auto Trait Implementations§

§

impl<I, S> Freeze for ConcurrentEach<I, S>
where S: Freeze,

§

impl<I, S> !RefUnwindSafe for ConcurrentEach<I, S>

§

impl<I, S> Send for ConcurrentEach<I, S>
where S: Send, <S as Service<I>>::Out: Send,

§

impl<I, S> Sync for ConcurrentEach<I, S>
where S: Sync, I: Sync, <S as Service<I>>::Out: Send,

§

impl<I, S> Unpin for ConcurrentEach<I, S>
where S: Unpin, I: Unpin,

§

impl<I, S> !UnwindSafe for ConcurrentEach<I, S>

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<I, T> ServiceExt<I> for T
where I: Send, T: Service<I>,

Source§

fn flow<O1, O2, E1, E2, U>(self, service: U) -> (Self, U)
where Self: Sized + Service<I, Out = Result<O1, E1>> + Send, U: Send + Service<O1, Out = Result<O2, E2>>, O1: Send, O2: Send, E1: Send, E2: Send,

Source§

fn flow_inspect<O, E, F>(self, f: F) -> (Self, Inspect<O, E, F>)
where Self: Sized + Service<I, Out = Result<O, E>> + Send, F: Fn(&O) + Send, O: Send, E: Send,

Adds an inspection step that invokes the supplied callback on every successful output of the wrapped service. Read more
Source§

fn concurrent_each(self, limit: usize) -> ConcurrentEach<I, Self>
where Self: Sized + Send + Clone + 'static, Self::Out: Send,

Creates a concurrent wrapper around the current service that limits the number of parallel executions. Read more
Source§

fn spawn_each(self) -> SpawnEach<I, Self>
where Self: Sized + Send + Clone + 'static, Self::Out: Send,

Creates a new SpawnEach wrapper around the current service. Read more
Source§

fn flow_scope<O, M, E1, S, F>(self, f: F, s: S) -> (Self, Scope<O, M, E1, S, F>)
where F: Fn(&O) -> Result<M, E1>, Self: Sized + Send, O: Send, E1: Send,

Creates a scoped service wrapper that transforms incoming messages before passing to the wrapped service. Read more
Source§

fn flow_map<O1, O2, E1, F, H>(self, f: F) -> (Self, Map<O2, F>)
where Self: Sized + Service<I, Out = Result<O1, E1>> + Send, F: FnMut(O1) -> H + Send, H: Future<Output = O2> + Send, O1: Send, O2: Send, E1: Send,

Source§

fn flow_filter_map<O1, O2, E1, F, H>(self, f: F) -> (Self, FilterMap<O2, F>)
where Self: Sized + Service<I, Out = Result<O1, E1>> + Send, O1: Send, O2: Send, E1: Send, F: FnMut(O1) -> H + Send, H: Future<Output = Option<O2>> + Send,

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.