Skip to main content

Route

Struct Route 

Source
pub struct Route {
    pub match_: Match,
    pub mode: Mode,
    pub ladder: Vec<String>,
    pub gates: Vec<String>,
    pub deferred_gates: Vec<String>,
    pub routing_mode: Option<RoutingMode>,
    pub rollout: Option<Rollout>,
    pub shadow: Option<Shadow>,
}
Expand description

One routing rule.

Fields§

§match_: Match

The traffic this route claims. An empty match ({}) matches everything.

§mode: Mode

Serving mode.

§ladder: Vec<String>

Model ladder, cheapest first, as provider/model strings.

§gates: Vec<String>

Inline gates run before serving (enforce mode).

§deferred_gates: Vec<String>

Gates run asynchronously after serving; their verdicts attach to the trace as a learning signal and never block the response.

§routing_mode: Option<RoutingMode>

Per-route routing-mode preset. Overrides FIRSTPASS_MODE_PROFILE; overridden by the per-request x-firstpass-mode header. Absent (default None) falls through to the global default, then Balanced — byte-identical to existing behaviour.

§rollout: Option<Rollout>

Percentage rollout (ADR 0009 D1): enforce only a slice of this route’s matched traffic, held constant per session so a conversation never flips arm mid-thread. Absent (the default) enforces all matched traffic — byte-identical to existing behaviour.

§shadow: Option<Shadow>

Shadow scoring (ADR 0009 D2): on a sample of observed requests, run the ladder off the hot path and record what would have been served and what it would have cost. Absent (the default) leaves observe exactly as it was. Makes real model calls when enabled, which is why max_usd_per_day is required rather than defaulted.

Trait Implementations§

Source§

impl Clone for Route

Source§

fn clone(&self) -> Route

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 Route

Source§

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

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

impl<'de> Deserialize<'de> for Route

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Freeze for Route

§

impl RefUnwindSafe for Route

§

impl Send for Route

§

impl Sync for Route

§

impl Unpin for Route

§

impl UnsafeUnpin for Route

§

impl UnwindSafe for Route

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.