pub struct ServiceInstallCtx {
pub label: ServiceLabel,
pub program: PathBuf,
pub args: Vec<OsString>,
pub contents: Option<String>,
pub username: Option<String>,
pub working_directory: Option<PathBuf>,
pub environment: Option<Vec<(String, String)>>,
pub autostart: bool,
}
Expand description
Context provided to the install function of ServiceManager
Fields§
§label: ServiceLabel
Label associated with the service
E.g. org.example.my_application
program: PathBuf
Path to the program to run
E.g. /usr/local/bin/my-program
args: Vec<OsString>
Arguments to use for the program
E.g. --arg
, value
, --another-arg
contents: Option<String>
Optional contents of the service file for a given ServiceManager to use instead of the default template.
username: Option<String>
Optionally supply the user the service will run as
If not specified, the service will run as the root or Administrator user.
working_directory: Option<PathBuf>
Optionally specify a working directory for the process launched by the service
environment: Option<Vec<(String, String)>>
Optionally specify a list of environment variables to be passed to the process launched by the service
autostart: bool
Specify whether the service should automatically start on reboot
Implementations§
Trait Implementations§
Source§impl Clone for ServiceInstallCtx
impl Clone for ServiceInstallCtx
Source§fn clone(&self) -> ServiceInstallCtx
fn clone(&self) -> ServiceInstallCtx
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ServiceInstallCtx
impl Debug for ServiceInstallCtx
Source§impl PartialEq for ServiceInstallCtx
impl PartialEq for ServiceInstallCtx
impl Eq for ServiceInstallCtx
impl StructuralPartialEq for ServiceInstallCtx
Auto Trait Implementations§
impl Freeze for ServiceInstallCtx
impl RefUnwindSafe for ServiceInstallCtx
impl Send for ServiceInstallCtx
impl Sync for ServiceInstallCtx
impl Unpin for ServiceInstallCtx
impl UnwindSafe for ServiceInstallCtx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more