Skip to main content

EngineState

Struct EngineState 

Source
pub struct EngineState<S: WorkflowStore> {
    pub workflow: Arc<WorkflowCtx<S>>,
    pub dashboard: Arc<DashboardCtx>,
    pub auth: Option<AuthCtx>,
    pub vault: Option<VaultCtx>,
    pub admin_api_keys: Arc<Vec<String>>,
    pub modules: Arc<Vec<String>>,
    pub instance_id: Uuid,
    pub engine_version: &'static str,
    pub started_at: f64,
    pub engine_config: Arc<EngineConfig>,
}

Fields§

§workflow: Arc<WorkflowCtx<S>>§dashboard: Arc<DashboardCtx>§auth: Option<AuthCtx>

Composed auth context — present iff the runtime engine.modules.auth.enabled row is TRUE. axum::FromRef extracts it for the auth router’s handlers.

§vault: Option<VaultCtx>

Composed vault context — present iff the vault Cargo feature is on AND the runtime engine.modules.vault.enabled row is TRUE. Plan 17’s v0.3.0 module — KV / transit / collections / share / sealing / dynamic creds / BW-compat all hang off this.

§admin_api_keys: Arc<Vec<String>>

Admin API keys for the /admin/* HTTP surface — checked by auth handlers via axum::extract::FromRef<EngineState<S>> so the same value flows from engine.toml through to per-request auth gating without a global static. Empty when no admin surface is configured.

§modules: Arc<Vec<String>>

Names of modules attached/loaded during boot — surfaced through /healthz for ops visibility (which functional modules this engine instance has wired up).

§instance_id: Uuid

This instance’s row in engine.instances. Lets /healthz and future visibility endpoints identify which engine process is answering.

§engine_version: &'static str

assay-engine crate version. Returned in /api/v1/engine/core/health so external monitors can correlate health checks with deployments.

§started_at: f64

Wall-clock seconds since the UNIX epoch when this engine process finished booting. Surfaced through /api/v1/engine/core/info so the engine console can display “uptime” without an extra DB lookup per request — matches the value the engine wrote to its engine.instances row at boot.

§engine_config: Arc<EngineConfig>

Parsed engine.toml snapshot — admin endpoints serialise this (with secrets redacted) so the engine console’s “Config” pane shows the operator exactly what the running engine is using. Arc so cloning state per-request stays cheap.

Trait Implementations§

Source§

impl<S: Clone + WorkflowStore> Clone for EngineState<S>

Source§

fn clone(&self) -> EngineState<S>

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<S: WorkflowStore> FromRef<EngineState<S>> for AdminApiKeys

Source§

fn from_ref(s: &EngineState<S>) -> Self

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

impl<S: WorkflowStore> FromRef<EngineState<S>> for AuthCtx

Source§

fn from_ref(s: &EngineState<S>) -> Self

FromRef impl so auth handlers can extract the resolved AuthCtx via State<AuthCtx>. Panics when the engine binary mounted the auth router without composing an AuthCtx — a misconfiguration the engine boot path is responsible for preventing (the auth router is only mounted when state.auth.is_some()).

Source§

impl<S: WorkflowStore> FromRef<EngineState<S>> for VaultCtx

Available on crate feature vault only.
Source§

fn from_ref(s: &EngineState<S>) -> Self

FromRef impl so vault handlers (added Phase 1+) can extract the resolved VaultCtx via State<VaultCtx>. Panics when the vault router is mounted without composing a VaultCtx — same engine- boot-bug surface AuthCtx uses.

Auto Trait Implementations§

§

impl<S> Freeze for EngineState<S>

§

impl<S> !RefUnwindSafe for EngineState<S>

§

impl<S> Send for EngineState<S>

§

impl<S> Sync for EngineState<S>

§

impl<S> Unpin for EngineState<S>

§

impl<S> UnsafeUnpin for EngineState<S>

§

impl<S> !UnwindSafe for EngineState<S>

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,