pub struct Runner { /* private fields */ }Expand description
Immutable named route table.
Implementations§
Source§impl Runner
impl Runner
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, RunnerError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, RunnerError>
Loads and validates a version-1 deployment TOML file.
Sourcepub fn from_toml(source: &str) -> Result<Self, RunnerError>
pub fn from_toml(source: &str) -> Result<Self, RunnerError>
Loads and validates a version-1 deployment TOML document.
Use Self::load when the deployment is stored in a file.
Sourcepub fn new(routes: Vec<(ModelId, Route)>) -> Self
pub fn new(routes: Vec<(ModelId, Route)>) -> Self
Builds a runner from named routes in caller-provided order. Pre-condition: There must be at least one route.
Sourcepub fn with_provider_api_keys(self, keys: Vec<String>) -> Self
pub fn with_provider_api_keys(self, keys: Vec<String>) -> Self
Registers deployment-owned API keys for serving-surface output redaction. TOML loading registers these automatically; programmatic hosts must supply them.
Sourcepub fn provider_api_keys(&self) -> &[String]
pub fn provider_api_keys(&self) -> &[String]
Returns deployment-owned secrets for serving-surface output redactors.
Sourcepub fn models(&self) -> impl Iterator<Item = ModelInfo<'_>>
pub fn models(&self) -> impl Iterator<Item = ModelInfo<'_>>
Iterates over configured routes in caller-provided order.
Sourcepub fn fallback_base_url(&self) -> Option<&str>
pub fn fallback_base_url(&self) -> Option<&str>
Returns the validated API root used for unmatched HTTP requests.
Sourcepub fn describe_decision(
&self,
model: &ModelId,
outcome: &RoutingOutcome,
) -> Option<DecisionDescription>
pub fn describe_decision( &self, model: &ModelId, outcome: &RoutingOutcome, ) -> Option<DecisionDescription>
Resolves an outcome to configured target names and non-secret client settings.
Auto Trait Implementations§
impl !RefUnwindSafe for Runner
impl !UnwindSafe for Runner
impl Forget for Runner
impl Freeze for Runner
impl Move for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more