CloningForkService

Struct CloningForkService 

Source
pub struct CloningForkService<S1, S2> { /* private fields */ }
Expand description

A Service, MutService, or AsyncService that encapsulates two service and accepts a Cloneable input, which is passed to both underlying services, returning their outputs as a tuple.

Implementations§

Source§

impl<S1, S2> CloningForkService<S1, S2>

Source

pub fn new(first: S1, second: S2) -> Self

Trait Implementations§

Source§

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

Source§

type Input = <S1 as AsyncService>::Input

Source§

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

Source§

type Error = <S1 as AsyncService>::Error

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,

Source§

impl<S1: MutService, S2: MutService<Input = S1::Input, Error = S1::Error>> MutService for CloningForkService<S1, S2>
where S1::Input: Clone,

Source§

type Input = <S1 as MutService>::Input

Source§

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

Source§

type Error = <S1 as MutService>::Error

Source§

fn process(&mut self, input: Self::Input) -> Result<Self::Output, Self::Error>

Source§

fn into_dyn<'a>( self, ) -> DynMutService<'a, Self::Input, Self::Output, Self::Error>
where Self: Sized + 'static,

Convert this Service into a DynMutService
Source§

impl<S1: Service, S2: Service<Input = S1::Input, Error = S1::Error>> Service for CloningForkService<S1, S2>
where S1::Input: Clone,

Source§

type Input = <S1 as Service>::Input

Source§

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

Source§

type Error = <S1 as Service>::Error

Source§

fn process(&self, input: Self::Input) -> Result<Self::Output, Self::Error>

Process an input, producing a Result<Self::Output, Self::Error>
Source§

fn into_mut(self) -> ServiceMut<Self>
where Self: Sized,

Convert this Service into a ServiceMut which impls MutService
Source§

fn into_async(self) -> ServiceAsync<Self>
where Self: Sized + Send + Sync + 'static,

Convert this Service into a ServiceAsync which impls AsyncService
Source§

fn into_dyn<'a>(self) -> DynService<'a, Self::Input, Self::Output, Self::Error>
where Self: Sized + 'static,

Convert this Service into a DynService

Auto Trait Implementations§

§

impl<S1, S2> Freeze for CloningForkService<S1, S2>
where S1: Freeze, S2: Freeze,

§

impl<S1, S2> RefUnwindSafe for CloningForkService<S1, S2>

§

impl<S1, S2> Send for CloningForkService<S1, S2>
where S1: Send, S2: Send,

§

impl<S1, S2> Sync for CloningForkService<S1, S2>
where S1: Sync, S2: Sync,

§

impl<S1, S2> Unpin for CloningForkService<S1, S2>
where S1: Unpin, S2: Unpin,

§

impl<S1, S2> UnwindSafe for CloningForkService<S1, S2>
where S1: UnwindSafe, S2: 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> 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.