pub struct DefaultLauncher { /* private fields */ }Expand description
The default Launcher: relaunches with the library’s
RESUME_FLAG and spawns a detached child process. Used
unless UpdateManager::with_launcher
installs a different one.
It can carry extra command-line arguments and environment variables through to
the relaunched process, so the common cases need no custom Launcher:
use update_rs::DefaultLauncher;
let launcher = DefaultLauncher::new()
.with_arg("--updated")
.with_env("APP_UPDATING", "1");Implementations§
Source§impl DefaultLauncher
impl DefaultLauncher
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a default launcher with no extra arguments or environment variables.
Sourcepub fn with_arg(self, arg: impl Into<OsString>) -> Self
pub fn with_arg(self, arg: impl Into<OsString>) -> Self
Append a custom argument to every relaunch, after the resume arguments. Call repeatedly to add several.
Sourcepub fn with_args<I, A>(self, args: I) -> Self
pub fn with_args<I, A>(self, args: I) -> Self
Append several custom arguments to every relaunch.
Trait Implementations§
Source§impl Clone for DefaultLauncher
impl Clone for DefaultLauncher
Source§fn clone(&self) -> DefaultLauncher
fn clone(&self) -> DefaultLauncher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DefaultLauncher
impl Debug for DefaultLauncher
Source§impl Default for DefaultLauncher
impl Default for DefaultLauncher
Source§fn default() -> DefaultLauncher
fn default() -> DefaultLauncher
Returns the “default value” for a type. Read more
Source§impl Launcher for DefaultLauncher
impl Launcher for DefaultLauncher
Source§fn extra_args(&self) -> Vec<OsString>
fn extra_args(&self) -> Vec<OsString>
Extra command-line arguments to append to the relaunch command, after the
resume_args. Read moreSource§fn extra_envs(&self) -> Vec<(OsString, OsString)>
fn extra_envs(&self) -> Vec<(OsString, OsString)>
Extra environment variables to set on the relaunched process (added to,
not replacing, the inherited environment). Read more
Source§fn resume_args(&self, state_json: &str) -> Vec<OsString>
fn resume_args(&self, state_json: &str) -> Vec<OsString>
The arguments that carry the serialized resume
state_json to the
relaunched process. Read moreSource§fn detach(&self, cmd: &mut Command)
fn detach(&self, cmd: &mut Command)
Apply the platform-specific flags that detach the relaunched process from
the current console so it survives the parent exiting (a detached process
in its own group on Windows). A no-op on non-Windows platforms. Exposed so
custom
launch implementations can reuse it.Auto Trait Implementations§
impl Freeze for DefaultLauncher
impl RefUnwindSafe for DefaultLauncher
impl Send for DefaultLauncher
impl Sync for DefaultLauncher
impl Unpin for DefaultLauncher
impl UnsafeUnpin for DefaultLauncher
impl UnwindSafe for DefaultLauncher
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