Skip to main content

ServerConfig

Struct ServerConfig 

Source
pub struct ServerConfig {
    pub host: String,
    pub port: u16,
    pub channel: String,
    pub auth_token: String,
    pub log_level: String,
    pub log_format: String,
    pub log_file: Option<String>,
    pub database_url: Option<String>,
    pub config_path: Option<String>,
    pub strict_type_driven_transport: bool,
    pub default_backend: Option<String>,
    pub schemas_dir: Option<String>,
}
Expand description

Server configuration — mirrors CLI args for axon serve.

Fields§

§host: String§port: u16§channel: String§auth_token: String§log_level: String§log_format: String

Log output format: “json” or “pretty”.

§log_file: Option<String>

Optional directory for daily-rotated log files.

§database_url: Option<String>

PostgreSQL connection URL (for persistent storage).

§config_path: Option<String>

Optional path for persisted config file.

§strict_type_driven_transport: bool

§Fase 31.d (D6) — Type-Driven Wire Inference activation flag.

When true, POST /v1/execute promotes to SSE for any flow the type-checker inferred as stream-producing (i.e. the AxonEndpoint AST node carries implicit_transport == "sse") REGARDLESS of the Accept: header. The D1 inference becomes the wire’s authoritative source.

When false (D6 default in v1.22.x — backwards-compat first), the Fase 30.e D4 + D5 negotiation matrix is preserved verbatim. Only the additive 31.e diagnostic header is observable for existing clients.

D9 ratified — this flag flips to default true in v2.0.0 (Fase 35+ candidate) with the full migration guide already published in docs/MIGRATION_v1.22.md (31.h).

Adopters opt in via three converging surfaces (31.f):

  • CLI: axon serve --strict-type-driven-transport
  • Config file: [server] strict_type_driven_transport = true
  • Env var: AXON_STRICT_TYPE_DRIVEN_TRANSPORT=1
§default_backend: Option<String>

§Fase 36.g (D7) — Server-wide default execution backend.

Rung 3 of the Fase 36 Backend Resolution Contract ladder: when a request behind an axonendpoint names no backend (rung 1) and the route declares none (rung 2), this server default is consulted before the environment-available auto rungs.

None ≡ no server default — resolution falls straight through to the auto rungs (operator-tuned registry scores → the providers with an API key in the environment). A Some("auto") value is transparent — it behaves as None at the ladder. Lets an operator pin a fleet-wide default without editing a single .axon.

Adopters set it via three converging surfaces (D7 — mirrors the strict_type_driven_transport precedence):

  • CLI: axon serve --backend <name>
  • Env var: AXON_DEFAULT_BACKEND=<name>
  • Programmatic: this field. The CLI flag wins when both CLI and env are set. The value is validated against the closed catalog (parser::AXONENDPOINT_BACKEND_VALUES) at run_serve startup — an unknown name fails fast, before the first request is served.
§schemas_dir: Option<String>

§Fase 38.j (D3 + D7 + D8) — Directory containing declared store- schema manifests (*.axon-schema.json files at the project root and/or under a schemas/ subdirectory).

When Some(path), POST /v1/deploy loads and merges every manifest under the directory before running the deploy-time store verification pass. The declared columns of every Fase 38 schema: form (a/b/c) are then proven AGAINST the live Postgres introspection — any drift fails the deploy with structured axon-T807 (DeclaredVsLiveDrift) diagnostics. axon-T805 (manifest hash mismatch) and axon-T806 (missing per-tenant env var) also surface here.

None ≡ no manifest loading — the v1.37.0 verify behavior is preserved verbatim (D5 absolute backwards-compat). An adopter who never adopts Fase 38’s compile-time schema observes ZERO behavior change at deploy.

Adopters set it via three converging surfaces (D7 — mirrors the default_backend precedence):

  • CLI: axon serve --schemas-dir <path>
  • Env var: AXON_SCHEMAS_DIR=<path>
  • Programmatic: this field. The CLI flag wins when both CLI and env are set. An empty value collapses to None. The directory’s existence is NOT verified at startup — a missing dir resolves to “no manifest files” the same way an empty dir does (load_and_merge_manifests is total).

Implementations§

Source§

impl ServerConfig

Source

pub fn auth_enabled(&self) -> bool

Whether authentication is enabled.

Source

pub fn bind_addr(&self) -> String

The bind address string (host:port).

Trait Implementations§

Source§

impl Clone for ServerConfig

Source§

fn clone(&self) -> ServerConfig

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 ServerConfig

Source§

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

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

impl Default for ServerConfig

§Fase 50.d/2 (v2.4.0) — minimal ServerConfig for embedded callers (notably axon-enterprise’s runtime executor that constructs ServerState to drive server_execute_streaming).

Defaults: in-memory channel (no DB), no auth token, INFO logs to stdout, no persisted state path. Adopters that need persistence or auth construct ServerConfig explicitly. This default is total + side-effect-free: ServerState::new(ServerConfig::default()) produces a fresh in-memory state with no on-disk recovery attempted (when config_path is None).

Source§

fn default() -> Self

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

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.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

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

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

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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