pub struct DriverConfig {
pub provider_type: DriverId,
pub api_key: Option<String>,
pub credentials: BTreeMap<String, String>,
pub base_url: Option<String>,
pub metadata: ProviderMetadata,
}Expand description
Everything a DriverFactory receives to build a driver instance.
Replaces the old (api_key, base_url) factory arguments so that
embedder-defined providers can receive richer auth via ProviderMetadata
without changing the factory signature again.
Fields§
§provider_type: DriverIdProvider type being created.
api_key: Option<String>Raw credential document, when one is configured. None for keyless
providers (LlmSim, or external providers that authenticate via
ProviderMetadata). For single-key drivers this is the API key
verbatim; multi-field drivers should read DriverConfig::credentials
instead of parsing this string.
credentials: BTreeMap<String, String>Typed credential fields parsed from the stored credential document (see
crate::credential_schema::parse_credential_document). Multi-field
drivers (Bedrock AWS keys, MAI Entra OAuth) read their declared fields
from here instead of hand-parsing JSON out of api_key. Empty for
keyless providers.
base_url: Option<String>Base URL override, when configured.
metadata: ProviderMetadataExtra provider-specific metadata.
Implementations§
Source§impl DriverConfig
impl DriverConfig
Sourcepub fn from_provider_config(config: &ProviderConfig) -> Self
pub fn from_provider_config(config: &ProviderConfig) -> Self
Build a driver config from a resolved ProviderConfig, parsing the
credential document into the typed DriverConfig::credentials map.
This is the single point where the stored credential string becomes
typed fields, so every driver-creation path (server, worker, sync, dev)
gets the same typed view.
Sourcepub fn credential(&self, name: &str) -> Option<&str>
pub fn credential(&self, name: &str) -> Option<&str>
A declared credential field’s non-empty value, if present.
Trait Implementations§
Source§impl Clone for DriverConfig
impl Clone for DriverConfig
Source§fn clone(&self) -> DriverConfig
fn clone(&self) -> DriverConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DriverConfig
impl RefUnwindSafe for DriverConfig
impl Send for DriverConfig
impl Sync for DriverConfig
impl Unpin for DriverConfig
impl UnsafeUnpin for DriverConfig
impl UnwindSafe for DriverConfig
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request