Struct auto_launch::AutoLaunch
source · [−]pub struct AutoLaunch { /* private fields */ }Expand description
Implementations
sourceimpl AutoLaunch
impl AutoLaunch
Linux implement
sourcepub fn new(app_name: &str, app_path: &str, args: &[impl AsRef<str>]) -> AutoLaunch
pub fn new(app_name: &str, app_path: &str, args: &[impl AsRef<str>]) -> AutoLaunch
Create a new AutoLaunch instance
app_name: application nameapp_path: application pathargs: startup args passed to the binary
Notes
The parameters of AutoLaunch::new are different on each platform.
sourcepub fn enable(&self) -> Result<()>
pub fn enable(&self) -> Result<()>
Enable the AutoLaunch setting
Errors
- failed to create dir
~/.config/autostart - failed to create file
~/.config/autostart/{app_name}.desktop - failed to write bytes to the file
sourcepub fn is_enabled(&self) -> Result<bool>
pub fn is_enabled(&self) -> Result<bool>
Check whether the AutoLaunch setting is enabled
sourceimpl AutoLaunch
impl AutoLaunch
sourcepub fn is_support() -> bool
pub fn is_support() -> bool
check whether it is support the platform
Usage
use auto_launch::AutoLaunch;
dbg!(AutoLaunch::is_support());sourcepub fn get_app_name(&self) -> &str
pub fn get_app_name(&self) -> &str
get the application name
sourcepub fn get_app_path(&self) -> &str
pub fn get_app_path(&self) -> &str
get the application path
Trait Implementations
sourceimpl Clone for AutoLaunch
impl Clone for AutoLaunch
sourcefn clone(&self) -> AutoLaunch
fn clone(&self) -> AutoLaunch
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 AutoLaunch
impl Debug for AutoLaunch
sourceimpl PartialEq<AutoLaunch> for AutoLaunch
impl PartialEq<AutoLaunch> for AutoLaunch
sourcefn eq(&self, other: &AutoLaunch) -> bool
fn eq(&self, other: &AutoLaunch) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Eq for AutoLaunch
impl StructuralEq for AutoLaunch
impl StructuralPartialEq for AutoLaunch
Auto Trait Implementations
impl RefUnwindSafe for AutoLaunch
impl Send for AutoLaunch
impl Sync for AutoLaunch
impl Unpin for AutoLaunch
impl UnwindSafe for AutoLaunch
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