pub enum LaunchConfig {
Simple(String),
Advanced {
command: String,
args: Vec<String>,
env_files: Vec<String>,
env: HashMap<String, String>,
},
}Expand description
Launch configuration - supports simple command string or advanced config
Provides two forms: simple (just a command string) and advanced (with args, env files, and env vars).
§Examples
§Simple Launch
use open_sesame::config::LaunchConfig;
let simple = LaunchConfig::Simple("firefox".to_string());
assert_eq!(simple.command(), "firefox");
assert!(simple.args().is_empty());§Advanced Launch
use open_sesame::config::LaunchConfig;
use std::collections::HashMap;
let mut env = HashMap::new();
env.insert("EDITOR".to_string(), "vim".to_string());
let advanced = LaunchConfig::Advanced {
command: "ghostty".to_string(),
args: vec!["--config".to_string(), "custom.toml".to_string()],
env_files: vec!["~/.config/ghostty/.env".to_string()],
env,
};
assert_eq!(advanced.command(), "ghostty");
assert_eq!(advanced.args().len(), 2);Variants§
Implementations§
Source§impl LaunchConfig
impl LaunchConfig
Sourcepub fn env_files(&self) -> &[String]
pub fn env_files(&self) -> &[String]
Returns environment files to load (empty for simple config).
Sourcepub fn to_launch_command(&self) -> LaunchCommand
pub fn to_launch_command(&self) -> LaunchCommand
Converts to a LaunchCommand for execution.
Trait Implementations§
Source§impl Clone for LaunchConfig
impl Clone for LaunchConfig
Source§fn clone(&self) -> LaunchConfig
fn clone(&self) -> LaunchConfig
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 moreSource§impl Debug for LaunchConfig
impl Debug for LaunchConfig
Source§impl<'de> Deserialize<'de> for LaunchConfig
impl<'de> Deserialize<'de> for LaunchConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LaunchConfig
impl RefUnwindSafe for LaunchConfig
impl Send for LaunchConfig
impl Sync for LaunchConfig
impl Unpin for LaunchConfig
impl UnwindSafe for LaunchConfig
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.