pub struct ServiceStatus {
pub service_type: ServiceType,
pub current_state: ServiceState,
pub controls_accepted: ServiceControlAccept,
pub exit_code: ServiceExitCode,
pub checkpoint: u32,
pub wait_hint: Duration,
pub process_id: Option<u32>,
}Expand description
Service status.
This struct wraps the lower level SERVICE_STATUS providing a few convenience types to fill
in the service status information. However it doesn’t fully guard the developer from producing
an invalid ServiceStatus, therefore please refer to the corresponding MSDN article and in
particular how to fill in the exit_code, checkpoint, wait_hint fields:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms685996(v=vs.85).aspx
Fields§
§service_type: ServiceTypeType of service.
current_state: ServiceStateCurrent state of the service.
controls_accepted: ServiceControlAcceptControl commands that service accepts.
exit_code: ServiceExitCodeThe error code the service uses to report an error that occurs when it is starting or stopping.
checkpoint: u32Service initialization progress value that should be increased during a lengthy start, stop, pause or continue operations. For example the service should increment the value as it completes each step of initialization. This value must be zero if the service does not have any pending start, stop, pause or continue operations.
wait_hint: DurationEstimated time for pending operation.
This basically works as a timeout until the system assumes that the service hung.
This could be either circumvented by updating the ServiceStatus::current_state or
incrementing a ServiceStatus::checkpoint value.
§Panics
Converting this to the FFI form will panic if the duration is too large to fit as
milliseconds in a u32.
process_id: Option<u32>Process ID of the service This is only retrieved when querying the service status.
Trait Implementations§
Source§impl Clone for ServiceStatus
impl Clone for ServiceStatus
Source§fn clone(&self) -> ServiceStatus
fn clone(&self) -> ServiceStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more