pub struct AiConfig {
pub request_timeout: Duration,
pub connect_timeout: Duration,
pub max_request_body_bytes: usize,
pub upstreams: Vec<AiUpstream>,
}Expand description
Fully resolved AI configuration (what AppState serves from).
Fields§
§request_timeout: DurationWhole-request deadline for one proxied upstream call.
connect_timeout: DurationConnect deadline for one proxied upstream call.
max_request_body_bytes: usizeRequest-body maximum on the proxy route.
upstreams: Vec<AiUpstream>Upstreams, sorted by id (TOML’s BTreeMap order preserved).
Implementations§
Source§impl AiConfig
impl AiConfig
Sourcepub fn resolve(
flag_enabled: bool,
toml: Option<AiToml>,
) -> Result<Option<Self>, AiConfigError>
pub fn resolve( flag_enabled: bool, toml: Option<AiToml>, ) -> Result<Option<Self>, AiConfigError>
Resolve the enabled state and all fields.
flag_enabled is --with-ai; toml is the parsed ai.toml, when
found. Returns None when neither enables the feature. Upstream
preconfiguration: an enabled config with no declared upstreams gets
the single zen upstream; declared upstreams are the complete set.
Trait Implementations§
impl Eq for AiConfig
impl StructuralPartialEq for AiConfig
Auto Trait Implementations§
impl Freeze for AiConfig
impl RefUnwindSafe for AiConfig
impl Send for AiConfig
impl Sync for AiConfig
impl Unpin for AiConfig
impl UnsafeUnpin for AiConfig
impl UnwindSafe for AiConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].