pub struct LaunchdInstall {
pub label: String,
pub domain: LaunchdDomain,
pub target: String,
pub plist_path: PathBuf,
pub definition: Vec<u8>,
pub bootstrap_on_install: bool,
pub transition_timeout: Duration,
}Expand description
Caller-owned launchd install material.
Fields§
§label: StringJob label (for example com.example.daemon).
domain: LaunchdDomainExplicit domain (never guessed).
target: StringBootstrap target: gui/<uid> for user agents, system for daemons.
plist_path: PathBufAbsolute plist path supplied by the caller.
definition: Vec<u8>Exact desired plist bytes (caller-owned content).
bootstrap_on_install: boolWhether install should bootstrap the job (explicit only).
transition_timeout: DurationBounded wait for state transitions.
Implementations§
Source§impl LaunchdInstall
impl LaunchdInstall
Sourcepub fn new(
label: String,
domain: LaunchdDomain,
target: String,
plist_path: PathBuf,
definition: Vec<u8>,
bootstrap_on_install: bool,
transition_timeout: Duration,
) -> Result<Self, ServiceError>
pub fn new( label: String, domain: LaunchdDomain, target: String, plist_path: PathBuf, definition: Vec<u8>, bootstrap_on_install: bool, transition_timeout: Duration, ) -> Result<Self, ServiceError>
Validates install material.
§Errors
ServiceError::InvalidInput when the label or target is empty,
overlong, or contains a control character, when the domain and target
disagree (a user-agent target must look like gui/<uid>, a
system-daemon target must be system), when the plist path is not
absolute, when the definition bytes are empty, overlong, or contain a
NUL byte, or when the transition timeout is zero or above
MAX_TRANSITION_TIMEOUT.