pub struct BackgroundServiceHost { /* private fields */ }Expand description
Runs a BackgroundService as an IHostedService.
Registered for you by add_background_service*; construct it directly only
when you need to compose it yourself.
Implementations§
Source§impl BackgroundServiceHost
impl BackgroundServiceHost
Sourcepub fn new(service: Arc<dyn BackgroundService>) -> Self
pub fn new(service: Arc<dyn BackgroundService>) -> Self
Wrap service so the host can start and stop it.
Trait Implementations§
Source§impl IHostedService for BackgroundServiceHost
impl IHostedService for BackgroundServiceHost
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called when the host starts. Read more
Auto Trait Implementations§
impl !Freeze for BackgroundServiceHost
impl !RefUnwindSafe for BackgroundServiceHost
impl !UnwindSafe for BackgroundServiceHost
impl Forget for BackgroundServiceHost
impl Move for BackgroundServiceHost
impl Send for BackgroundServiceHost
impl Sync for BackgroundServiceHost
impl Unpin for BackgroundServiceHost
impl UnsafeUnpin for BackgroundServiceHost
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