pub struct RegisteredTask { /* private fields */ }Expand description
What Task Scheduler says about a task that is registered.
Implementations§
Source§impl RegisteredTask
impl RegisteredTask
Sourcepub fn from_document(name: &str, document: &str, running: bool) -> Self
pub fn from_document(name: &str, document: &str, running: bool) -> Self
Reads the fields this module cares about out of a /Query /XML
document.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Its description.
Sourcepub fn running(&self) -> bool
pub fn running(&self) -> bool
Whether Task Scheduler reports it as running.
Read from localised output, exactly as
crate::service’s Windows backend reads it, and for the same reason:
schtasks /Query /FO CSV prints its Status column in the machine’s
display language and there is no locale-independent equivalent short of
COM. On a non-English Windows this is false for a task that is in fact
running. The authority for “is the Linux host healthy” is the Linux
service’s own status, never this. wsl install does branch on it, and
only where a wrong false is harmless: it runs /Run on a current
task that already runs, which IgnoreNew makes a no-op, and it skips
restarting a task it re-registered, which leaves the old companion
running until the next logon rather than doing anything to it.
Sourcepub fn is_product_owned(&self) -> bool
pub fn is_product_owned(&self) -> bool
Whether this product created it.
The gate on every mutation. See the module documentation: the name is derived, so it can collide with a hand-made task, and the marker is what tells the two apart.