pub struct ServiceIdentity { /* private fields */ }Expand description
How this process is named as an OS service.
Combines the binary name (used by systemd and Windows), a reverse-DNS label prefix (used by launchd), and an instance discriminator (a port, an identity key, …) so one binary can run multiple service instances.
Implementations§
Source§impl ServiceIdentity
impl ServiceIdentity
Sourcepub fn new(
binary_name: BinaryName,
launchd_prefix: LaunchdLabelPrefix,
instance: impl Into<ServiceInstance>,
) -> Self
pub fn new( binary_name: BinaryName, launchd_prefix: LaunchdLabelPrefix, instance: impl Into<ServiceInstance>, ) -> Self
Describe a service instance from already-validated values.
binary_name— the installed binary, e.g.my-daemon;launchd_prefix— the reverse-DNS launchd prefix, e.g.com.example.my-daemon;instance— the per-instance suffix, e.g. an HTTP port or a node identity key. Au16port converts directly.
Sourcepub fn launchd_label(&self) -> String
pub fn launchd_label(&self) -> String
The macOS launchd label: {launchd_prefix}.{instance}.
Sourcepub fn systemd_unit_name(&self) -> String
pub fn systemd_unit_name(&self) -> String
The Linux systemd template-unit name:
{binary_name}@{instance}.service.
Sourcepub fn windows_service_name(&self) -> String
pub fn windows_service_name(&self) -> String
The Windows service name: {binary_name}-{instance}.
Sourcepub fn service_label(&self) -> String
pub fn service_label(&self) -> String
The service label for the platform this process runs on.
Sourcepub fn detect(&self, markers: &DaemonMarkers) -> DaemonState
pub fn detect(&self, markers: &DaemonMarkers) -> DaemonState
Full daemon detection for this identity: whether the process is a daemon and, when it is, the derived service label and system-versus-user mode.
Trait Implementations§
Source§impl Clone for ServiceIdentity
impl Clone for ServiceIdentity
Source§impl Debug for ServiceIdentity
impl Debug for ServiceIdentity
impl Eq for ServiceIdentity
Source§impl PartialEq for ServiceIdentity
impl PartialEq for ServiceIdentity
impl StructuralPartialEq for ServiceIdentity
Auto Trait Implementations§
impl Forget for ServiceIdentity
impl Freeze for ServiceIdentity
impl Move for ServiceIdentity
impl RefUnwindSafe for ServiceIdentity
impl Send for ServiceIdentity
impl Sync for ServiceIdentity
impl Unpin for ServiceIdentity
impl UnsafeUnpin for ServiceIdentity
impl UnwindSafe for ServiceIdentity
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