pub struct ServiceContext { /* private fields */ }
Expand description
Service thread context that gets passed to the service This contains all the control mechanisms
Implementations§
Source§impl ServiceContext
impl ServiceContext
pub fn new( wait_point: Arc<Notify>, has_notified: Arc<AtomicBool>, stopped: Arc<AtomicBool>, ) -> Self
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Check if service is stopped
Sourcepub async fn wait_for_running(&self, interval: Duration) -> bool
pub async fn wait_for_running(&self, interval: Duration) -> bool
Wait for running with interval
pub fn wakeup(&self)
Auto Trait Implementations§
impl Freeze for ServiceContext
impl RefUnwindSafe for ServiceContext
impl Send for ServiceContext
impl Sync for ServiceContext
impl Unpin for ServiceContext
impl UnwindSafe for ServiceContext
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