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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 ServiceContext,
) -> Pin<Box<dyn Future<Output = Result<(), ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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>where
F: Freeze,
impl<F> Move for FnService<F>
impl<F> RefUnwindSafe for FnService<F>where
F: RefUnwindSafe,
impl<F> Send for FnService<F>where
F: Send,
impl<F> Sync for FnService<F>where
F: Sync,
impl<F> Unpin for FnService<F>where
F: Unpin,
impl<F> UnsafeUnpin for FnService<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FnService<F>where
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