pub struct GatewayConfig {
pub enabled: bool,
pub routes: Vec<GatewayRoute>,
pub default_provider: Option<ProviderId>,
pub allow_unlisted_models: bool,
pub auth_scheme: String,
pub inference_path_prefix: String,
pub system_prompt_overrides: Vec<SystemPromptRule>,
pub bridge_releases: Option<BridgeReleasesSpec>,
}Expand description
Runtime gateway configuration: the post-resolution shape every non-loader caller sees.
Not Deserialize: the only legal construction paths are
GatewayConfigSpec::resolve for the production loader and direct
struct-literal construction in tests.
Fields§
§enabled: bool§routes: Vec<GatewayRoute>§default_provider: Option<ProviderId>§allow_unlisted_models: bool§auth_scheme: String§inference_path_prefix: String§system_prompt_overrides: Vec<SystemPromptRule>§bridge_releases: Option<BridgeReleasesSpec>Implementations§
Source§impl GatewayConfig
impl GatewayConfig
pub fn find_route(&self, model: &str) -> Option<&GatewayRoute>
pub fn candidate_routes<'a>( &'a self, registry: &ProviderRegistry, ) -> impl Iterator<Item = Cow<'a, GatewayRoute>>
pub fn resolve_route<'a>( &'a self, registry: &ProviderRegistry, request: &CanonicalRequest, ) -> Option<Cow<'a, GatewayRoute>>
pub fn dispatchable_route_ids( &self, registry: &ProviderRegistry, ) -> Vec<RouteId>
pub fn is_model_exposed(&self, registry: &ProviderRegistry, model: &str) -> bool
pub fn validate(&self, registry: &ProviderRegistry) -> GatewayResult<()>
pub fn to_spec(&self) -> GatewayConfigSpec
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GatewayConfig
impl Debug for GatewayConfig
Auto Trait Implementations§
impl Freeze for GatewayConfig
impl RefUnwindSafe for GatewayConfig
impl Send for GatewayConfig
impl Sync for GatewayConfig
impl Unpin for GatewayConfig
impl UnsafeUnpin for GatewayConfig
impl UnwindSafe for GatewayConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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