pub struct Dialect {
pub name: &'static str,
pub base_url: &'static str,
pub api_key_env: &'static str,
pub base_url_env: Option<&'static str>,
pub request_id_header: Option<&'static str>,
pub alternate_auth: Option<AuthAlternative>,
pub quirks: Quirks,
}Expand description
Provider identity, endpoint defaults, and shared-wire policies.
Fields§
§name: &'static strThe provider descriptor name, as records and telemetry name it.
base_url: &'static strThe default base URL.
api_key_env: &'static strThe environment variable holding the credential.
base_url_env: Option<&'static str>The environment variable overriding the base URL, when the provider has one.
request_id_header: Option<&'static str>The reply header carrying the provider’s transport request id.
alternate_auth: Option<AuthAlternative>A second credential this dialect accepts, with its own variable and
header. None for every dialect but Azure.
quirks: QuirksEverything that is not identity.
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub const fn gateway(
name: &'static str,
base_url: &'static str,
api_key_env: &'static str,
) -> Self
pub const fn gateway( name: &'static str, base_url: &'static str, api_key_env: &'static str, ) -> Self
Create a dialect with Quirks::openai and the supplied identity.
URL overrides, request-ID headers, and alternative credentials are unset.
Sourcepub const fn with_quirks(self, quirks: Quirks) -> Self
pub const fn with_quirks(self, quirks: Quirks) -> Self
This dialect with quirks.
Trait Implementations§
impl Copy for Dialect
Source§impl<'de> Deserialize<'de> for Dialect
impl<'de> Deserialize<'de> for Dialect
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Dialect
Source§impl Serialize for Dialect
Serialize the registered dialect name, rejecting unregistered or modified definitions.
Deserialization resolves that name from this build’s registry.
impl Serialize for Dialect
Serialize the registered dialect name, rejecting unregistered or modified definitions. Deserialization resolves that name from this build’s registry.
impl StructuralPartialEq for Dialect
Auto Trait Implementations§
impl Freeze for Dialect
impl RefUnwindSafe for Dialect
impl Send for Dialect
impl Sync for Dialect
impl Unpin for Dialect
impl UnsafeUnpin for Dialect
impl UnwindSafe for Dialect
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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