pub struct MaybeProcessService<S: Service> { /* private fields */ }Expand description
A Service that processes a Option<T> as input, processing with an underlying Service<Input = T>
when the input is Some, producing Option<S::Output> as output.
When None is passed as input, None will be produced as output.
When Some(T) is passed as input, Some(S::Output) will be produced as output.
Implementations§
Trait Implementations§
Source§impl<T, S: Service<Input = T>> Service for MaybeProcessService<S>
impl<T, S: Service<Input = T>> Service for MaybeProcessService<S>
type Input = Option<T>
type Output = Option<<S as Service>::Output>
type Error = <S as Service>::Error
Source§fn process(&self, input: Option<T>) -> Result<Self::Output, Self::Error>
fn process(&self, input: Option<T>) -> 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,
fn into_mut(self) -> ServiceMut<Self>where
Self: Sized,
Source§fn into_async(self) -> ServiceAsync<Self>
fn into_async(self) -> ServiceAsync<Self>
Source§fn into_dyn<'a>(self) -> DynService<'a, Self::Input, Self::Output, Self::Error>where
Self: Sized + 'static,
fn into_dyn<'a>(self) -> DynService<'a, Self::Input, Self::Output, Self::Error>where
Self: Sized + 'static,
Convert this
Service into a DynServiceAuto Trait Implementations§
impl<S> Freeze for MaybeProcessService<S>where
S: Freeze,
impl<S> RefUnwindSafe for MaybeProcessService<S>where
S: RefUnwindSafe,
impl<S> Send for MaybeProcessService<S>where
S: Send,
impl<S> Sync for MaybeProcessService<S>where
S: Sync,
impl<S> Unpin for MaybeProcessService<S>where
S: Unpin,
impl<S> UnwindSafe for MaybeProcessService<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more