Skip to main content

InstallRequest

Struct InstallRequest 

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

What service install was asked for, before anything has been resolved.

Separate from InstallPlan because a request is the operator’s words and a plan is what the host actually supports: the plan carries a resolved absolute binary path, the account the start mode obliges, and the four directories the registration is installed against, none of which the caller supplies.

Implementations§

Source§

impl InstallRequest

Source

pub fn new(start_mode: StartMode) -> Self

Register the binary that is running this call.

Source

pub const fn started_on_demand(self) -> Self

Registers the service but does not ask the manager to start it by itself.

Production never uses this: a boot-mode registration that does not start at boot is the failure service status reports. The privileged installer tests use it for every fixture they create, so that a registration which somehow escaped its cleanup guard cannot start with the owner’s machine on the next reboot. A leaked service is bad; a leaked service that runs is worse, and the difference costs one flag.

Source

pub fn for_binary(self, binary: impl Into<PathBuf>) -> Self

Register a named binary instead of the running one.

The privileged installer tests use this to register a fixture service host. Production does not: 05-infrastructure.md item 6 is specifically about the path of the running binary, and letting an operator name a different one would defeat the stale-path detection it asks for.

Source

pub fn copied_from(self, source: impl Into<PathBuf>) -> Self

Where the registered binary was copied from.

§Why a registration has a source at all

A service registered directly against a package manager’s own file can never be upgraded on Windows, because the running service holds that file open and npm i -g cannot replace it. What it does instead is worse than failing: it rewrites the package metadata, reports success, and leaves the old executable in place — so the operator is told the new version is installed while the old one keeps running. That was observed, twice in a row, before this existed.

So the service runs a copy the product owns, and this records where that copy came from. The source is what a package manager updates, what inspect_binary watches for item 6’s stale-path case, and what the daemon compares its own version against to know an upgrade is waiting.

Source

pub fn with_arguments<I, S>(self, arguments: I) -> Self
where I: IntoIterator<Item = S>, S: Into<OsString>,

Replace the registered arguments. Defaults to DAEMON_ARGUMENTS.

Source

pub const fn with_restart(self, restart: RestartPolicy) -> Self

Replace the restart-on-failure policy. Defaults to RestartPolicy::default.

Source

pub const fn start_mode(&self) -> StartMode

The start mode asked for.

Trait Implementations§

Source§

impl Clone for InstallRequest

Source§

fn clone(&self) -> InstallRequest

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 InstallRequest

Source§

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

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

impl Eq for InstallRequest

Source§

impl PartialEq for InstallRequest

Source§

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

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