Skip to main content

GatewayConfig

Struct GatewayConfig 

Source
pub struct GatewayConfig {
    pub mode: DeploymentMode,
    pub local: LocalModeConfig,
    pub remote: RemoteModeConfig,
    pub agent: AgentConnectConfig,
    pub storage: StorageConfig,
}
Expand description

Top-level gateway configuration loaded at startup.

Composes the four sub-configs and a DeploymentMode flag. All fields use #[serde(default)] so a minimal YAML — even an empty document — deserialises into the documented defaults.

Fields§

§mode: DeploymentMode

Which topology to boot — local-dev or remote control-plane.

§local: LocalModeConfig

Settings for mode = Local.

§remote: RemoteModeConfig

Settings for mode = Remote.

§agent: AgentConnectConfig

Settings the SDK FFI shim reads to dial the gateway.

§storage: StorageConfig

Durable-persistence configuration (Epic 18 — AAASM-1569).

Implementations§

Source§

impl GatewayConfig

Source

pub fn expand_paths(&mut self)

Expand a leading ~ in every path field to the user’s home directory.

Touches local.storage_path and both remote.tls paths. A no-op when the home directory cannot be resolved or when no field starts with ~. Idempotent — calling twice produces the same result as calling once.

Source§

impl GatewayConfig

Source

pub fn apply_env_overrides(&mut self) -> Result<(), ConfigError>

Apply the documented AA_MODE / AAASM_* environment variables on top of self, overriding any fields they set.

Returns ConfigError::InvalidMode / ConfigError::InvalidPort when an env var has been set to a value that cannot be parsed.

Source§

impl GatewayConfig

Source

pub fn validate(&self) -> Result<(), ConfigError>

Validate the fully-loaded config — call this after expand_paths and apply_env_overrides so values coming in from env vars are included in the checks.

Currently enforces two storage-retention invariants from E18 S-H (AAASM-1582):

Source§

impl GatewayConfig

Source

pub fn resolve_storage_backend(&mut self)

Infer storage.backend from mode when it was not explicitly set in YAML or via the AAASM_STORAGE_BACKEND env var.

  • mode: Localstorage.backend = Sqlite
  • mode: Remotestorage.backend = Postgres

No-op when the operator explicitly set storage.backend in YAML or via AAASM_STORAGE_BACKEND — their choice always wins, including the odd-but-valid mode: remote + storage.backend: sqlite combo (an in-memory test runner pointed at the remote API surface).

Trait Implementations§

Source§

impl Clone for GatewayConfig

Source§

fn clone(&self) -> GatewayConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GatewayConfig

Source§

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

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

impl Default for GatewayConfig

Source§

fn default() -> GatewayConfig

Returns the “default value” for a type. Read more
Source§

impl Eq for GatewayConfig

Source§

impl PartialEq for GatewayConfig

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for GatewayConfig

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.