Trait sod::AsyncService

source ·
pub trait AsyncService: Send + Sync {
    type Input: Send + 'static;
    type Output: Send + 'static;
    type Error: Send + 'static;

    // Required method
    fn process<'life0, 'async_trait>(
        &'life0 self,
        input: Self::Input
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An async service trait

Uses the async_trait to accept &self and an input asynchronously, producing a Result<Self::Output, Self::Error>

Required Associated Types§

source

type Input: Send + 'static

source

type Output: Send + 'static

source

type Error: Send + 'static

Required Methods§

source

fn process<'life0, 'async_trait>( &'life0 self, input: Self::Input ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<'a, I, O, E> AsyncService for DynAsyncService<'a, I, O, E>where I: Send + 'static, O: Send + 'static, E: Send + 'static,

§

type Input = I

§

type Output = O

§

type Error = E

source§

impl<'a, S: Service + Send + Sync> AsyncService for ServiceAsync<S>where S::Input: Send + 'static, S::Output: Send + 'static, S::Error: Send + 'static,

§

type Input = <S as Service>::Input

§

type Output = <S as Service>::Output

§

type Error = <S as Service>::Error

source§

impl<'a, T: Send + 'static> AsyncService for NoOpService<'a, T>

§

type Input = T

§

type Output = T

§

type Error = Infallible

source§

impl<O, E, S, F> AsyncService for PollService<E, S, F>where O: Send + 'static, E: Send + 'static, S: AsyncService<Input = (), Output = Option<O>, Error = E> + Send + Sync, F: Fn(usize) -> Result<(), RetryError<E>> + Send + Sync,

§

type Input = ()

§

type Output = O

§

type Error = RetryError<<S as AsyncService>::Error>

source§

impl<P: AsyncService + Send + Sync, S: AsyncService<Input = P::Output> + Send + Sync> AsyncService for ServiceChain<P, S>where P::Error: Debug + Send + 'static, S::Error: Debug + Send + 'static, P::Output: Send, S::Output: Send,

source§

impl<S1: AsyncService, S2: AsyncService<Input = S1::Input, Error = S1::Error>> AsyncService for CloningForkService<S1, S2>where S1::Input: Clone + Sync,

§

type Input = <S1 as AsyncService>::Input

§

type Output = (<S1 as AsyncService>::Output, <S2 as AsyncService>::Output)

§

type Error = <S1 as AsyncService>::Error

source§

impl<S, F> AsyncService for RetryService<S::Error, S, F>where S: AsyncService + Retryable<S::Input, S::Error> + Send + Sync, F: Fn(usize) -> Result<(), RetryError<S::Error>> + Send + Sync,

source§

impl<S: AsyncService> AsyncService for ArcAsyncService<S>

§

type Input = <S as AsyncService>::Input

§

type Output = <S as AsyncService>::Output

§

type Error = <S as AsyncService>::Error