Skip to main content

DynamicEndpointRoute

Struct DynamicEndpointRoute 

Source
pub struct DynamicEndpointRoute {
Show 16 fields pub flow_name: String, pub endpoint_name: String, pub source_file: String, pub source: String, pub transport: String, pub transport_explicit: bool, pub keepalive: String, pub implicit_transport: String, pub body_type: String, pub output_type: String, pub requires_capabilities: Vec<String>, pub replay_enabled: bool, pub transport_dialect: String, pub has_algebraic_stream_effect: bool, pub backend: String, pub path_params: Vec<String>,
}
Expand description

Metadata stored per registered dynamic route. Populated at deploy time from AxonEndpointDefinition; consulted at request time by the fallback handler to dispatch to the correct flow with the correct transport semantics.

Fields§

§flow_name: String

The flow name the axonendpoint’s execute: field declared.

§endpoint_name: String

The axonendpoint name (for diagnostic + audit).

§source_file: String

Source file the axonendpoint was deployed from. Used by the negotiation classifier (Fase 30.e + Fase 31.d) for source-text dual-signal predicate.

§source: String

Full source of the deployed program. Required for runtime transport inference (Fase 31.b produces_stream predicate).

§transport: String

transport: field verbatim — one of {json, sse, ndjson} per Fase 30 D2; empty string when omitted (Fase 31.b transport_explicit == false path).

§transport_explicit: bool

Was transport: explicitly declared in source (Fase 31.b)?

§keepalive: String

keepalive: field per Fase 30 D6; empty when omitted.

§implicit_transport: String

Inferred transport per Fase 31.b D1 ("sse" / "json" / empty if pre-compute).

§body_type: String

§Fase 32.c — Declared body type per body: field on the source axonendpoint. Empty string when omitted (D9 backwards-compat — the fallback handler skips body-schema validation entirely). When non-empty, the value is looked up in ServerState.dynamic_types at request time and the request body is validated against the resolved TypeSchema before the flow dispatch. Schema mismatch returns 400 Bad Request with a structured BodyValidationError.

§output_type: String

§Fase 32.d — Declared output type per output: field on the source axonendpoint. Empty string when omitted (D9 backwards- compat — the fallback handler skips output-schema validation). When non-empty, the flow’s response body is validated against the resolved TypeSchema BEFORE returning to the client. Per OWASP, validation failure returns a GENERIC 500 to the client + records the full diagnostic in audit_log so the adopter can fix the FLOW without schema details leaking to potentially malicious clients.

Output validation only fires when the response Content-Type is application/json — SSE/ndjson streams are token-by-token and cannot be validated against a static type at the wire layer (a future fase may add per-event validation for typed streams).

§requires_capabilities: Vec<String>

§Fase 32.g — Declared capability slugs the request bearer must hold for the endpoint to dispatch. Empty vec means “no auth gate” (D9 backwards-compat). The runtime checks declared_requires ⊆ token_capabilities (AND semantics — every declared capability must be present). On missing capability the fallback handler returns 403 Forbidden with structured {error: "missing_capability", required, have, ...} so the client knows precisely which capability is needed.

§replay_enabled: bool

§Fase 32.h — Effective replay-binding boolean resolved at deploy time. true ⟹ every successful 2xx POST/PUT response is recorded in ServerState.axonendpoint_replay keyed by trace_id. Default is method-derived (POST/PUT → true; GET/DELETE → false); an explicit replay: true | false declaration overrides.

§transport_dialect: String

§Fase 33.z.k.b (v1.28.0) — Selected SSE wire-format dialect.

Populated when the source declares transport: sse(<dialect>). Closed catalog from AXONENDPOINT_TRANSPORT_DIALECTS: {axon, openai, anthropic}. Empty string when the source declared a non-SSE transport, bare transport: sse without parens, or omitted transport: entirely.

Copied from AxonEndpointDefinition.transport_dialect at route construction. The runtime resolves the effective dialect via type_checker::resolve_effective_dialect() — when this field is empty, the algebraic-effect predicate drives the Q1 default (openai for tool-streaming flows, axon for type-annotation-only).

§has_algebraic_stream_effect: bool

§Fase 33.z.k.1 (v1.27.1) — Algebraic-effect override predicate.

true when execute_flow references a tool that declares effects: <stream:<policy>>. Copied verbatim from AxonEndpointDefinition.has_algebraic_stream_effect (computed by axon_frontend::type_checker::compute_implicit_transports).

Used by classify_dynamic_route_wire to OVERRIDE the v1.22.0 D6 backwards-compat gate. A tool with a declared stream effect is a LANGUAGE-LEVEL commitment to streaming (algebraic effect is part of the type), not a client preference. The runtime honors the commitment without requiring an Accept: text/event-stream header (D4 negotiation) or the strict-mode runtime flag (D6). D3 explicit transport: json opt-out still wins above this override.

§backend: String

§Fase 36.e (D3) — the route’s declared execution backend.

Resolved at deploy time: the axonendpoint backend: field (Fase 36.d, AxonEndpointDefinition.backend) if the source declared one; otherwise the deploy-request backend (DeployRequest.backend) when that was set to an explicit, concrete value (deploy_handler fills it as a deploy-scoped default for every route that did not declare its own).

Empty string "" ≡ “not declared” — the route resolves its backend at request time down the Fase 36 D1 precedence ladder (server default → environment-available auto; honest failure if nothing real resolves). When non-empty this value is rung 2 of that ladder (EndpointDeclared).

(D3 frames this as an “optional backend”; the struct realizes “optional” via its uniform empty-string-sentinel convention — shared with every sibling field — rather than introducing a lone Option<String>.)

§path_params: Vec<String>

§Fase 37.y (D1) — Path-parameter names extracted from the route’s path string (mirrors AxonEndpointDefinition.path_params). Empty Vec when the path has no {name} placeholders. Used by match_path_template to (a) gate template matching only on routes that DECLARED placeholders and (b) skip the linear scan for legacy (placeholder-less) routes that go through the fast exact-string lookup path (D5 backwards-compat — pre-37.y route performance preserved).

Trait Implementations§

Source§

impl Clone for DynamicEndpointRoute

Source§

fn clone(&self) -> DynamicEndpointRoute

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 DynamicEndpointRoute

Source§

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

Formats the value using the given formatter. 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