pub struct DeepSeekClientBuilder { /* private fields */ }
Expand description
A builder for constructing a DeepSeekClient
instance with customizable options.
The DeepSeekClientBuilder
allows you to configure the API key, timeout, and host
for the DeepSeekClient
before building it.
§Examples
ⓘ
let client = DeepSeekClientBuilder::new("your_api_key".to_string())
.timeout(30)
.build()
.expect("Failed to build client");
Implementations§
Source§impl DeepSeekClientBuilder
impl DeepSeekClientBuilder
Sourcepub fn new(api_key: String) -> Self
pub fn new(api_key: String) -> Self
Creates a new DeepSeekClientBuilder
with the specified API key.
§Arguments
api_key
- AString
containing the API key to be used for authentication.
§Returns
A new instance of DeepSeekClientBuilder
with default settings.
The default host is set to "https://api.deepseek.com"
, and no timeout is configured.
Sourcepub fn build(self) -> Result<DeepSeekClient>
pub fn build(self) -> Result<DeepSeekClient>
Builds the Client
instance using the configured options.
§Returns
A Result
containing the constructed Client
on success, or an error
if the client could not be built.
§Errors
This method will return an error if the underlying reqwest::blocking::DeepSeekClientBuilder
fails to build the client.
§Examples
ⓘ
let client = DeepSeekClientBuilder::new("your_api_key".to_string())
.timeout(30)
.build()
.expect("Failed to build client");
Auto Trait Implementations§
impl Freeze for DeepSeekClientBuilder
impl RefUnwindSafe for DeepSeekClientBuilder
impl Send for DeepSeekClientBuilder
impl Sync for DeepSeekClientBuilder
impl Unpin for DeepSeekClientBuilder
impl UnwindSafe for DeepSeekClientBuilder
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