pub type ServiceMain<T> = dyn Fn(Receiver<T>, Vec<String>, Option<Vec<String>>) -> Result<T> + Sync + Send;Expand description
Type signature of a service’s main function used by this library.
The three parameters are used as follows:
Receiver<T>: astd::sync::mpsc::Receiver<T>that is used to transmit service stop signals to the main function for handling.Vec<String>: the operating system arguments passed to the binary at process load time. For a binary running as a Windows Service, these are the arguments passed to-BinaryPathOption<Vec<String>>: the start parameters passed as part of Windows Service startup, if the binary is running as a Windows Service. This argument should beNoneif this is not running as a Windows Service