Skip to main content

RegisteredTask

Struct RegisteredTask 

Source
pub struct RegisteredTask { /* private fields */ }
Expand description

What Task Scheduler says about a task that is registered.

Implementations§

Source§

impl RegisteredTask

Source

pub fn from_document(name: &str, document: &str, running: bool) -> Self

Reads the fields this module cares about out of a /Query /XML document.

Source

pub fn name(&self) -> &str

The Task Scheduler name.

Source

pub fn command(&self) -> &str

The program it starts.

Source

pub fn arguments(&self) -> &str

The single argument string it stores.

Source

pub fn account(&self) -> Option<&str>

The account, when the document names one.

Source

pub fn description(&self) -> &str

Its description.

Source

pub fn enabled(&self) -> bool

Whether it is enabled.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for RegisteredTask

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RegisteredTask

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RegisteredTask

Source§

impl PartialEq for RegisteredTask

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RegisteredTask

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more