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 — user 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 variable 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: impl Into<String>) -> Self
pub fn service_account(self, name: impl Into<String>) -> Self
Add a Unix service-account name whose effective UID marks the process as a system daemon.
Sourcepub fn windows_service_env(self, variable: impl Into<String>) -> Self
pub fn windows_service_env(self, variable: impl Into<String>) -> 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§fn clone(&self) -> DaemonMarkers
fn clone(&self) -> DaemonMarkers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DaemonMarkers
impl Debug for DaemonMarkers
Source§impl Default for DaemonMarkers
impl Default for DaemonMarkers
Source§fn default() -> DaemonMarkers
fn default() -> DaemonMarkers
Returns the “default value” for a type. Read more
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