Skip to main content

UpstreamDefinition

Struct UpstreamDefinition 

Source
pub struct UpstreamDefinition {
Show 18 fields pub name: String, pub transport: String, pub protocol: String, pub role: String, pub resolve: String, pub resource_ref: String, pub secret: String, pub auth_kind: String, pub auth_name: Option<String>, pub auth_prefix: Option<String>, pub map: Vec<UpstreamMapRule>, pub reconnect: Option<UpstreamReconnect>, pub overflow: Option<String>, pub backpressure_credit: Option<i64>, pub preset: Option<String>, pub loc: Loc, pub leading_trivia: Vec<Trivia>, pub trailing_trivia: Vec<Trivia>,
}
Expand description

upstream Name { transport:, protocol:, role:, resolve:, secret:, auth:, map: [...], reconnect: {...}, overflow:, backpressure: credit(n) }

v2.37.0 — the client dual of socket: axon dials OUT to a third-party vendor (STT/TTS/realtime speech APIs). The axon-facing interface is a declared session (referenced by protocol:, same field meaning as socket) of which axon plays role:; the vendor side is realised by the map: projection rules — a compile-time-total transcoding contract (v2.37.0, axon-T849). resolve:/secret: name per-tenant config keys, never URL/credential literals (axon-T850) — the same “config, not code” property v2.8.0 gave tool, extended to persistent duplex streams.

Fields§

§name: String§transport: String

Wire transport axon dials. Closed catalog; v1 sole member websocket.

§protocol: String

The referenced session declaration’s name — the axon-facing protocol.

§role: String

Which of the session’s two roles axon plays; the peer role is the vendor’s, realised by the map: transcoding, never by axon code.

§resolve: String

Per-tenant config key holding the vendor URL (dot-separated, SecretKeyPolicy-shaped — never a URL literal).

§resource_ref: String

v2.69.0 — the resource this upstream’s channel runs on (upstream X { resource: Api }). When present, the upstream DERIVES its dial address from resource.endpoint (a per-tenant config key, axon-T944) and its max concurrent connection INSTANCES from resource.capacity — frames are already governed by backpressure_credit, so capacity bounds CONNECTIONS, never frames (making it frames would state one fact twice). Mutually exclusive with resolve: (axon-T951): resource: beside a resolve: would declare the channel’s address twice — the v2.67.0 islands defect. Authority attenuation: the resource encapsulates its own address resolution; the upstream only names WHICH channel it rides.

§secret: String

Per-tenant secret binding for the vendor credential (same charset).

§auth_kind: String

Auth handshake kind: header | query | signed_url.

§auth_name: Option<String>

Header/query-param name (header("Authorization") / query("token")).

§auth_prefix: Option<String>

Optional header value prefix (header("Authorization", "Token ")).

§map: Vec<UpstreamMapRule>

The wire↔session transcoding contract; totality checked at v2.37.0.

§reconnect: Option<UpstreamReconnect>

reconnect: { backoff_ms:, max_attempts:, on_exhausted: }.

§overflow: Option<String>

Outbound-queue policy when the VENDOR is the slow side — a member of the existing BackpressurePolicy catalog. Nonefail (honest default: no silently-lossy audio unless the adopter opts in).

§backpressure_credit: Option<i64>

Axon-facing credit window, identical semantics to socket.

§preset: Option<String>

v2.37.0 — set when declared via upstream X from Preset@vN {…}; carries the Preset@vN reference the desugar pass expanded.

§loc: Loc§leading_trivia: Vec<Trivia>

v1.5.2 — leading comment trivia.

§trailing_trivia: Vec<Trivia>

v1.5.2 — trailing comment trivia.

Trait Implementations§

Source§

impl Debug for UpstreamDefinition

Source§

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

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

impl Default for UpstreamDefinition

Source§

fn default() -> UpstreamDefinition

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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