Struct auto_launch::AutoLaunchBuilder
source · [−]pub struct AutoLaunchBuilder {
pub app_name: Option<String>,
pub app_path: Option<String>,
pub use_launch_agent: bool,
pub args: Option<Vec<String>>,
}Expand description
AutoLaunch Builder helps to eliminate the constructor difference on various platforms.
Notes
The builder will not check whether the app_path matches the platform-specify file path.
Usage
use auto_launch::*;
fn main() {
let auto = AutoLaunchBuilder::new()
.set_app_name("the-app")
.set_app_path("/path/to/the-app")
.set_use_launch_agent(true)
.set_args(&["--minimized"])
.build()
.unwrap();
auto.enable().is_ok();
auto.is_enabled().unwrap();
auto.disable().is_ok();
auto.is_enabled().unwrap();
}Fields
app_name: Option<String>app_path: Option<String>use_launch_agent: boolargs: Option<Vec<String>>Implementations
sourceimpl AutoLaunchBuilder
impl AutoLaunchBuilder
pub fn new() -> AutoLaunchBuilder
sourcepub fn set_app_name(&mut self, name: &str) -> &mut Self
pub fn set_app_name(&mut self, name: &str) -> &mut Self
Set the app_name
sourcepub fn set_app_path(&mut self, path: &str) -> &mut Self
pub fn set_app_path(&mut self, path: &str) -> &mut Self
Set the app_path
sourcepub fn set_use_launch_agent(&mut self, use_launch_agent: bool) -> &mut Self
pub fn set_use_launch_agent(&mut self, use_launch_agent: bool) -> &mut Self
Set the use_launch_agent
This setting only works on macOS
Trait Implementations
sourceimpl Clone for AutoLaunchBuilder
impl Clone for AutoLaunchBuilder
sourcefn clone(&self) -> AutoLaunchBuilder
fn clone(&self) -> AutoLaunchBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AutoLaunchBuilder
impl Debug for AutoLaunchBuilder
sourceimpl Default for AutoLaunchBuilder
impl Default for AutoLaunchBuilder
sourcefn default() -> AutoLaunchBuilder
fn default() -> AutoLaunchBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for AutoLaunchBuilder
impl Send for AutoLaunchBuilder
impl Sync for AutoLaunchBuilder
impl Unpin for AutoLaunchBuilder
impl UnwindSafe for AutoLaunchBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more