pub enum WebSearchProviderConfig {
Fixture {
name: String,
default: bool,
results: Vec<WebFixtureResult>,
},
Http {
name: String,
default: bool,
url_template: String,
api_key_env: Option<String>,
hosts: Vec<String>,
},
}Expand description
One [[web.search_providers]] entry (ADR-175 A1.3). The provider is
operator configuration; web.search’s provider argument only selects
among entries declared here by name. Closed, tagged on kind.
Variants§
Fixture
Deterministic canned results — no outbound request.
Http
A real HTTP GET search backend. url_template must contain the
literal substring {query}, replaced with the percent-encoded query
at request time; {limit} is replaced with the effective limit when
present. The response body is JSON: an array of {title, url, snippet} objects. api_key_env, when set, is a process environment
variable sent as Authorization: Bearer <value>.
Fields
hosts: Vec<String>Hosts (exact IP literals or hostname suffixes) api_key_env’s
value may be presented to, modeled on
[[web.credentials]].hosts. Required non-empty whenever
api_key_env is set (validate enforces this) — an unscoped key
would ride along to whatever host url_template resolves to,
which defeats the point of scoping it at all.
Implementations§
Trait Implementations§
Source§impl Clone for WebSearchProviderConfig
impl Clone for WebSearchProviderConfig
Source§impl Debug for WebSearchProviderConfig
impl Debug for WebSearchProviderConfig
Source§impl<'de> Deserialize<'de> for WebSearchProviderConfig
impl<'de> Deserialize<'de> for WebSearchProviderConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WebSearchProviderConfig
impl RefUnwindSafe for WebSearchProviderConfig
impl Send for WebSearchProviderConfig
impl Sync for WebSearchProviderConfig
impl Unpin for WebSearchProviderConfig
impl UnsafeUnpin for WebSearchProviderConfig
impl UnwindSafe for WebSearchProviderConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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