pub struct DevShellConfig {
pub packages: BTreeSet<String>,
pub shell_hook: Option<String>,
pub pure: Option<bool>,
}Expand description
@brief Represents the structure of the devshell.toml file.
Maintains a set of packages, an optional shell hook, and an optional purity flag. BTreeSet is used to keep packages sorted and unique.
Fields§
§packages: BTreeSet<String>@brief Set of package names to be included in the development shell.
shell_hook: Option<String>@brief Optional shell hook command to be executed in the shell.
pure: Option<bool>@brief Optional flag to indicate if the shell should be pure.
Implementations§
Source§impl DevShellConfig
impl DevShellConfig
Sourcepub fn load() -> Result<Self, Error>
pub fn load() -> Result<Self, Error>
@brief Loads the configuration from CONFIG_FILE or returns a default config if not found. @return Result containing the loaded DevShellConfig or an I/O error.
Sourcepub fn save(&self) -> Result<(), Error>
pub fn save(&self) -> Result<(), Error>
@brief Saves the current configuration to CONFIG_FILE. @return Result indicating success or an I/O error.
Sourcepub fn append_hook(&mut self, new_hook: &str)
pub fn append_hook(&mut self, new_hook: &str)
@brief Appends a new shell hook command to the existing shell hook.
If a shell hook already exists, the new hook is appended with a separator. If not, the new hook is set as the shell hook. @param new_hook The shell hook command to append.