Skip to main content

Registration

Struct Registration 

Source
pub struct Registration {
    pub manager: DefinitionKind,
    pub start_mode: StartMode,
    pub command_line: String,
    pub account: Option<String>,
    pub running: bool,
    pub starts_automatically: bool,
    pub restart_delay: Option<Duration>,
}
Expand description

What a service manager says about a registration it holds.

Fields§

§manager: DefinitionKind

Which manager holds it, which is also what decides the start mode: a Windows service is a boot registration and a Task Scheduler task is a login one; a LaunchDaemon and a system unit are boot, a LaunchAgent and a user unit are login.

§start_mode: StartMode

The start mode the domain it was found in implies.

§command_line: String

The full command line, as the manager stores it.

§account: Option<String>

The account it runs under, when the manager reports one.

§running: bool

Whether it is running now.

§starts_automatically: bool

Whether it will start by itself.

Distinct from Registration::start_mode: a Windows service can be registered in the boot domain and still be set to demand start, which is a service that exists, looks installed, and does not come back after a reboot.

§restart_delay: Option<Duration>

The restart-on-failure delay the manager reports, when it reports one.

The delay rather than the whole RestartPolicy, because that is the half every one of the four managers can be asked for. The failure-count reset window has no representation at all in Task Scheduler or launchd, so a RestartPolicy read back from them would carry one number the manager reported and one this module invented — and a comparison against an invented number is a comparison that cannot fail.

Implementations§

Source§

impl Registration

Source

pub fn binary(&self) -> Option<PathBuf>

The executable the manager will start, parsed out of the command line.

Trait Implementations§

Source§

impl Clone for Registration

Source§

fn clone(&self) -> Registration

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 Registration

Source§

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

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

impl Eq for Registration

Source§

impl PartialEq for Registration

Source§

fn eq(&self, other: &Registration) -> 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 Registration

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