pub struct ConnectionOptions {
pub base_url: Option<String>,
pub proxy: Option<String>,
pub api_key: Option<String>,
pub timeout: Option<Duration>,
pub disable_proxy: bool,
}
Expand description
Minimal explicit connection/configuration options.
Library users can pass an instance of this struct to AiClient::with_options
to
explicitly control base URL, proxy, API key and timeout without relying exclusively
on environment variables. Any field left as None
will fall back to existing
environment variable behavior or library defaults.
Fields§
§base_url: Option<String>
§proxy: Option<String>
§api_key: Option<String>
§timeout: Option<Duration>
§disable_proxy: bool
Implementations§
Source§impl ConnectionOptions
impl ConnectionOptions
Sourcepub fn hydrate_with_env(self, provider_env_prefix: &str) -> Self
pub fn hydrate_with_env(self, provider_env_prefix: &str) -> Self
Hydrate unset fields from environment variables (lightweight fallback logic).
provider_env_prefix
may be something like OPENAI
, GROQ
, etc., used to look up
a provider specific API key prior to the generic fallback AI_API_KEY
.
Trait Implementations§
Source§impl Clone for ConnectionOptions
impl Clone for ConnectionOptions
Source§fn clone(&self) -> ConnectionOptions
fn clone(&self) -> ConnectionOptions
Returns a duplicate of the value. Read more
1.0.0 · 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 ConnectionOptions
impl Debug for ConnectionOptions
Auto Trait Implementations§
impl Freeze for ConnectionOptions
impl RefUnwindSafe for ConnectionOptions
impl Send for ConnectionOptions
impl Sync for ConnectionOptions
impl Unpin for ConnectionOptions
impl UnwindSafe for ConnectionOptions
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