pub struct FnService<F> { /* private fields */ }Expand description
A Service from a closure.
Implementations§
Trait Implementations§
Source§impl<F, Fut> Service for FnService<F>
impl<F, Fut> Service for FnService<F>
fn name(&self) -> &str
fn schedule(&self) -> Schedule
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 ServiceContext,
) -> Pin<Box<dyn Future<Output = Result<(), ServiceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FnService<F>: 'async_trait,
Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 ServiceContext,
) -> Pin<Box<dyn Future<Output = Result<(), ServiceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 ServiceContext,
) -> Pin<Box<dyn Future<Output = Result<(), ServiceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Once, before any service’s first run. A failure is reported and the
service still runs.
Auto Trait Implementations§
impl<F> Forget for FnService<F>
impl<F> Freeze for FnService<F>
impl<F> Move for FnService<F>
impl<F> RefUnwindSafe for FnService<F>where
F: RefUnwindSafe,
impl<F> Send for FnService<F>
impl<F> Sync for FnService<F>
impl<F> Unpin for FnService<F>
impl<F> UnsafeUnpin for FnService<F>
impl<F> UnwindSafe for FnService<F>where
RawVecInner: UnwindSafe,
F: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more