pub enum RuntimeMode {
Installed,
Portable,
Dev {
branch: String,
},
}Expand description
Where this AgentMux binary is running from. Determines data path
layout (see crate::DataPaths).
Variants§
Installed
Installed via the platform installer (msi/dmg/deb). State lives
in ~/.agentmux/versions/<v>/.
Portable
Running from an extracted portable ZIP. State STILL lives in
~/.agentmux/versions/<v>/ (not under the portable folder) —
portable binaries are stateless on disk.
Dev
Running from a source-tree build. State lives in
~/.agentmux/dev/<branch>/ so different branches don’t share
state.
Implementations§
Source§impl RuntimeMode
impl RuntimeMode
Sourcepub fn current(exe_dir: &Path) -> Self
pub fn current(exe_dir: &Path) -> Self
Detect runtime mode from the launcher’s vantage point. Call
ONCE at process startup. Subsequent processes read the
AGENTMUX_RUNTIME_MODE env var via Self::from_env.
exe_dir should be current_exe().parent() of the binary
doing the detection (typically the launcher).
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
Read mode from the AGENTMUX_RUNTIME_MODE env var the launcher
set. Used by host + srv to consume the launcher’s decision
without re-detecting (which would re-introduce the desync risk
the legacy code had).
Sourcepub fn current_path_only(exe_dir: &Path) -> Self
pub fn current_path_only(exe_dir: &Path) -> Self
Path-only detection — skips the AGENTMUX_RUNTIME_MODE env step.
Use when the env can’t be trusted (e.g., the binary was launched
as a child of a different AgentMux process that set its own
AGENTMUX_* vars). Mirrors the rest of Self::current’s
priority order (portable marker → dev exe path → installed).
Sourcepub fn to_env_string(&self) -> String
pub fn to_env_string(&self) -> String
Encode for the AGENTMUX_RUNTIME_MODE env var. Round-trips
with [parse_mode_string].
Trait Implementations§
Source§impl Clone for RuntimeMode
impl Clone for RuntimeMode
Source§fn clone(&self) -> RuntimeMode
fn clone(&self) -> RuntimeMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more