pub struct QuestradeClientBuilder { /* private fields */ }Expand description
Builder for QuestradeClient that allows injecting a custom
reqwest::Client for TLS, proxy, or timeout configuration.
§Required
token_manager— must be set before callingbuild.
§Optional
http_client— if omitted, a default client with 30 s request timeout and 10 s connect timeout is created.
§Example
let client = QuestradeClientBuilder::new()
.token_manager(tm)
.build()?;Implementations§
Source§impl QuestradeClientBuilder
impl QuestradeClientBuilder
Sourcepub fn token_manager(self, tm: TokenManager) -> Self
pub fn token_manager(self, tm: TokenManager) -> Self
Set the TokenManager used for OAuth token management (required).
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Provide a pre-configured reqwest::Client for HTTP requests.
Use this to customise TLS roots, proxy settings, timeouts, or any
other reqwest::ClientBuilder option. When omitted, a default
client is created with a 30 s overall timeout and a 10 s connect
timeout.
Sourcepub fn build(self) -> Result<QuestradeClient>
pub fn build(self) -> Result<QuestradeClient>
Consume the builder and create a QuestradeClient.
§Errors
Returns an error if:
token_managerwas not set.- No custom HTTP client was provided and building the default client fails (e.g. TLS initialisation error).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuestradeClientBuilder
impl !RefUnwindSafe for QuestradeClientBuilder
impl Send for QuestradeClientBuilder
impl Sync for QuestradeClientBuilder
impl Unpin for QuestradeClientBuilder
impl UnsafeUnpin for QuestradeClientBuilder
impl !UnwindSafe for QuestradeClientBuilder
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