pub struct ServiceIdentity { /* private fields */ }Expand description
What the operating system calls this registration.
A type rather than three constants, for one reason that is not tidiness: the
privileged installer tests register a real service on a real machine,
and they must not be able to collide with — or remove — an operator’s
installation. ServiceIdentity::fixture produces a name that is
unmistakably a test artefact, and every backend takes its name from here, so
there is no path by which a test reaches the product’s own registration.
Implementations§
Source§impl ServiceIdentity
impl ServiceIdentity
Sourcepub fn fixture(tag: &str) -> Self
pub fn fixture(tag: &str) -> Self
A disposable registration for a privileged test, named so that it cannot
be mistaken for — or collide with — ServiceIdentity::product.
tag distinguishes concurrent runs; it is reduced to ASCII alphanumerics
and - so that it is a legal service name, launchd label, systemd unit
name, and Task Scheduler task name at once.
Sourcepub fn is_fixture(&self) -> bool
pub fn is_fixture(&self) -> bool
Whether this identity is a disposable test fixture.
The privileged tests assert this before they delete anything, which is the mechanical half of “never touch a service you did not create”.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The Windows service name, the systemd unit stem, and the Task Scheduler task name.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
The human-readable name.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
One line of explanation.
Sourcepub fn launchd_label(&self) -> String
pub fn launchd_label(&self) -> String
The launchd label — reverse-domain, as launchd expects.
Built from the same three product segments crate::paths resolves the
application-data directories with, so a label and a directory cannot
drift apart.
Sourcepub fn systemd_unit(&self) -> String
pub fn systemd_unit(&self) -> String
The systemd unit file name.
Trait Implementations§
Source§impl Clone for ServiceIdentity
impl Clone for ServiceIdentity
Source§fn clone(&self) -> ServiceIdentity
fn clone(&self) -> ServiceIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more