RuntimeMode

Enum RuntimeMode 

Source
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.

Fields

§branch: String

Implementations§

Source§

impl RuntimeMode

Source

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).

Source

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).

Source

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).

Source

pub fn to_env_string(&self) -> String

Encode for the AGENTMUX_RUNTIME_MODE env var. Round-trips with [parse_mode_string].

Source

pub fn dir_slug(&self) -> String

Slug used inside ~/.agentmux/ to separate state by mode. Stable across releases of the same major mode + branch.

Trait Implementations§

Source§

impl Clone for RuntimeMode

Source§

fn clone(&self) -> RuntimeMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RuntimeMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RuntimeMode

Source§

fn eq(&self, other: &RuntimeMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for RuntimeMode

Source§

impl StructuralPartialEq for RuntimeMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more