pub struct Env {
pub home: PathBuf,
pub config_roots: Vec<PathBuf>,
pub session: String,
pub key_dir: Option<PathBuf>,
pub no_raise: bool,
}Expand description
Where state lives and where apps keep their settings. Env::from_os for the real thing; tests
point both somewhere private.
Fields§
§home: PathBufState folder: sessions and default screenshots.
config_roots: Vec<PathBuf>Folders searched (a few levels deep) for control-key.local-<port> files.
session: StringThe session used when --session is not given.
key_dir: Option<PathBuf>ASHLAR_CONTROL_KEY_DIR, if set: the key folder for connect / --port without --key-dir.
no_raise: boolASHLAR_DEBUG_NO_RAISE: screenshots never raise a covered window (automated runs must not
steal focus from the person at the machine).
Implementations§
Source§impl Env
impl Env
Sourcepub fn from_os() -> Self
pub fn from_os() -> Self
ASHLAR_DEBUG_HOME (or the user cache folder + ashlar-debug), the OS settings folders,
ASHLAR_DEBUG_SESSION (or default), ASHLAR_DEBUG_NO_RAISE.
Sourcepub fn under(root: &Path) -> Self
pub fn under(root: &Path) -> Self
The folders of from_os under root instead (tests): state in <root>/home, settings
searched in <root>/config, nothing taken from the environment.
pub fn sessions_dir(&self) -> PathBuf
pub fn session_file(&self, name: &str) -> PathBuf
Sourcepub fn session_dir(&self, name: &str) -> PathBuf
pub fn session_dir(&self, name: &str) -> PathBuf
The folder holding a launched app’s key folder and log.