pub struct Service<'a> { /* private fields */ }Expand description
Configures and runs a Windows service.
Implementations§
Source§impl<'a> Service<'a>
impl<'a> Service<'a>
Sourcepub fn can_accept(&mut self, accept: u32) -> &mut Self
pub fn can_accept(&mut self, accept: u32) -> &mut Self
The service accepts other specified commands.
Sourcepub fn can_fallback<F: FnOnce(&Service<'_>) + Send + 'a>(
&mut self,
f: F,
) -> &mut Self
pub fn can_fallback<F: FnOnce(&Service<'_>) + Send + 'a>( &mut self, f: F, ) -> &mut Self
Runs the fallback closure if the service is not started by the Service Control Manager.
Sourcepub fn run<F: FnMut(&Service<'_>, Command) + Send + Sync + 'a>(
&mut self,
callback: F,
) -> Result<(), &'static str>
pub fn run<F: FnMut(&Service<'_>, Command) + Send + Sync + 'a>( &mut self, callback: F, ) -> Result<(), &'static str>
Runs the service with the given callback closure to receive commands sent by the service control manager.
Blocks while the service dispatcher runs. Returns after the service stops or the fallback closure completes.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Service<'a>
impl<'a> !RefUnwindSafe for Service<'a>
impl<'a> !UnwindSafe for Service<'a>
impl<'a> Unpin for Service<'a>
impl<'a> UnsafeUnpin for Service<'a>
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