pub struct Service(/* private fields */);Expand description
A service builder, providing control over what commands the service supports before the service begins to run.
Implementations§
Source§impl Service
impl Service
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Service object.
By default, the service does not accept any service commands other than start.
Sourcepub fn run<F: FnMut(Command) + Send + Sync>(&self, callback: F) -> !
pub fn run<F: FnMut(Command) + Send + Sync>(&self, callback: F) -> !
Runs the service with the given callback closure to receive commands sent by the service control manager.
This method will block for the life of the service. It will never return and immediately terminate the current process after indicating to the service control manager that the service has stopped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Service
impl RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl UnwindSafe for Service
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