SpawnEach

Struct SpawnEach 

Source
pub struct SpawnEach<M, S> { /* private fields */ }

Implementations§

Source§

impl<M, S> SpawnEach<M, S>
where M: Send, S: Service<M> + Send + Clone + 'static,

Source

pub fn new(service: S, buffer: usize) -> Self
where S::Out: Send,

Trait Implementations§

Source§

impl<M: Clone, S: Clone> Clone for SpawnEach<M, S>

Source§

fn clone(&self) -> SpawnEach<M, S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

Source§

type Out = Result<Receiver<Result<R, E>>, E>

Source§

fn handle( &mut self, input: M, 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<M, S> Freeze for SpawnEach<M, S>
where S: Freeze,

§

impl<M, S> RefUnwindSafe for SpawnEach<M, S>

§

impl<M, S> Send for SpawnEach<M, S>
where S: Send, M: Send,

§

impl<M, S> Sync for SpawnEach<M, S>
where S: Sync, M: Sync,

§

impl<M, S> Unpin for SpawnEach<M, S>
where S: Unpin, M: Unpin,

§

impl<M, S> UnwindSafe for SpawnEach<M, S>
where S: UnwindSafe, M: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 except<F>(self, on_err: F) -> Except<Self, F>
where Self: Sized,

Source§

fn flow_inspect<O, E, F>(self, f: F) -> Left<Self, Inspect<O, F>>
where Self: Sized + Service<I, Out = Result<O, E>> + Send, F: Fn(&O) + Send, O: 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_scope_each<O, M, E1, S, F>( self, f: F, s: S, ) -> (Self, ScopeEach<O, M, E1, S, F>)
where F: Fn(&O) -> Result<M, E1>, Self: Sized + Send, E1: Send, O: Send + Clone,

Source§

fn flow_map<O1, O2, E1, F, H>(self, f: F) -> Left<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) -> Left<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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.