pub struct InstallPlan { /* private fields */ }Expand description
Everything a backend needs, resolved and validated.
Constructing one is where 05-infrastructure.md item 6 is actually
satisfied: the binary path is made absolute and is confirmed to be a file
before anything is registered, so a registration that would fail at boot
is refused at install time instead.
Implementations§
Source§impl InstallPlan
impl InstallPlan
Sourcepub fn resolve(
identity: ServiceIdentity,
request: &InstallRequest,
directories: ServiceDirectories,
) -> Result<Self, ServiceError>
pub fn resolve( identity: ServiceIdentity, request: &InstallRequest, directories: ServiceDirectories, ) -> Result<Self, ServiceError>
Resolves a request against this host.
§Errors
ServiceError::BinaryPath when the running executable cannot be
located, and ServiceError::BinaryMissing when the path that would be
registered is not a file.
Sourcepub fn unchecked(
identity: ServiceIdentity,
start_mode: StartMode,
binary: impl Into<PathBuf>,
directories: ServiceDirectories,
) -> Self
pub fn unchecked( identity: ServiceIdentity, start_mode: StartMode, binary: impl Into<PathBuf>, directories: ServiceDirectories, ) -> Self
Builds a plan from values a caller already holds, without touching the filesystem.
This is what makes the renderers testable on a host that has none of the
paths involved: a Windows developer can render the systemd unit for
/opt/runner-manager/bin/runner-manager and assert every line of it.
Sourcepub const fn started_on_demand(self) -> Self
pub const fn started_on_demand(self) -> Self
Registers without arming the manager’s automatic start. See
InstallRequest::started_on_demand.
Sourcepub const fn is_on_demand(&self) -> bool
pub const fn is_on_demand(&self) -> bool
Whether the manager was asked not to start this by itself.
Sourcepub fn with_secret_guard(self, guard: impl Into<PathBuf>) -> Self
pub fn with_secret_guard(self, guard: impl Into<PathBuf>) -> Self
Names the file the machine-scoped secret store lives in, for the
systemd LoadCredential= line.
InstallPlan::resolve fills this from d2; a test names it directly
so that a Windows or macOS CI leg can assert the Linux unit’s credential
line for a path that platform does not have.
Sourcepub fn secret_guard(&self) -> Option<&Path>
pub fn secret_guard(&self) -> Option<&Path>
The file the machine-scoped secret store lives in, when one resolved.
Sourcepub const fn with_restart(self, restart: RestartPolicy) -> Self
pub const fn with_restart(self, restart: RestartPolicy) -> Self
Overrides the restart policy on an already-built plan.
Sourcepub fn with_arguments<I, S>(self, arguments: I) -> Self
pub fn with_arguments<I, S>(self, arguments: I) -> Self
Overrides the registered arguments on an already-built plan.
Sourcepub const fn identity(&self) -> &ServiceIdentity
pub const fn identity(&self) -> &ServiceIdentity
What the operating system calls this registration.
Sourcepub const fn start_mode(&self) -> StartMode
pub const fn start_mode(&self) -> StartMode
Boot or login.
Sourcepub fn source_binary(&self) -> Option<&Path>
pub fn source_binary(&self) -> Option<&Path>
Where Self::binary was copied from, when it is a copy.
None is the legacy layout: the registration names the file a package
manager owns, and cannot be upgraded while it runs. See
InstallRequest::copied_from.
Sourcepub const fn account(&self) -> &ServiceAccount
pub const fn account(&self) -> &ServiceAccount
The account it runs under.
Sourcepub const fn restart(&self) -> RestartPolicy
pub const fn restart(&self) -> RestartPolicy
The restart-on-failure policy.
Sourcepub const fn directories(&self) -> &ServiceDirectories
pub const fn directories(&self) -> &ServiceDirectories
The four directories it was installed against.
Sourcepub fn command_line(&self) -> String
pub fn command_line(&self) -> String
The command line as one string, quoted the way each platform expects.
Trait Implementations§
Source§impl Clone for InstallPlan
impl Clone for InstallPlan
Source§fn clone(&self) -> InstallPlan
fn clone(&self) -> InstallPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more