pub struct DaemonMarkers { /* private fields */ }Expand description
Environment markers that count as evidence the process is a daemon.
Two kinds of evidence are configurable on top of the built-in parent-process heuristics (parent PID 1 on Unix; on Windows, the built-ins alone never fire — supply an environment marker):
- Service accounts — validated account names whose effective UID marks
the process as a system daemon on Unix (e.g.
_mydaemonon macOS,mydaemonon Linux). - A Windows service environment variable — a validated variable name the service wrapper injects into the daemon’s environment.
Implementations§
Source§impl DaemonMarkers
impl DaemonMarkers
Sourcepub fn new() -> Self
pub fn new() -> Self
Markers with no service accounts and no Windows environment variable: only the parent-process heuristics apply.
Sourcepub fn service_account(self, name: ServiceAccountName) -> Self
pub fn service_account(self, name: ServiceAccountName) -> Self
Add a Unix service account whose effective UID marks the process as a system daemon.
Sourcepub fn windows_service_env(self, variable: EnvVarName) -> Self
pub fn windows_service_env(self, variable: EnvVarName) -> Self
Set the environment variable that a Windows service wrapper injects; its presence marks the process as a service.
Trait Implementations§
Source§impl Clone for DaemonMarkers
impl Clone for DaemonMarkers
Source§impl Debug for DaemonMarkers
impl Debug for DaemonMarkers
Auto Trait Implementations§
impl Freeze for DaemonMarkers
impl RefUnwindSafe for DaemonMarkers
impl Send for DaemonMarkers
impl Sync for DaemonMarkers
impl Unpin for DaemonMarkers
impl UnsafeUnpin for DaemonMarkers
impl UnwindSafe for DaemonMarkers
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