pub struct LaunchCommand {
pub command: String,
pub args: Vec<String>,
pub env_files: Vec<String>,
pub env: HashMap<String, String>,
}Expand description
A command to launch an application
Represents a command to execute with environment configuration support.
Created from crate::config::LaunchConfig for execution.
§Examples
use open_sesame::core::LaunchCommand;
// Simple command
let cmd = LaunchCommand::simple("firefox");
cmd.execute(&[])?;
// Advanced command with args and env
let mut env = std::collections::HashMap::new();
env.insert("EDITOR".to_string(), "vim".to_string());
let cmd = LaunchCommand::advanced(
"ghostty",
vec!["--config".to_string(), "custom.toml".to_string()],
vec!["~/.config/ghostty/.env".to_string()],
env,
);
cmd.execute(&[])?;Fields§
§command: StringThe command/binary to execute
args: Vec<String>Arguments to pass
env_files: Vec<String>Environment files to load (paths)
env: HashMap<String, String>Explicit environment variables
Implementations§
Source§impl LaunchCommand
impl LaunchCommand
Trait Implementations§
Source§impl Clone for LaunchCommand
impl Clone for LaunchCommand
Source§fn clone(&self) -> LaunchCommand
fn clone(&self) -> LaunchCommand
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for LaunchCommand
impl RefUnwindSafe for LaunchCommand
impl Send for LaunchCommand
impl Sync for LaunchCommand
impl Unpin for LaunchCommand
impl UnwindSafe for LaunchCommand
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.