pub struct ApiClientBuilder { /* private fields */ }Expand description
Builder for creating API clients with custom configuration
Implementations§
Source§impl ApiClientBuilder
impl ApiClientBuilder
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Create a new builder with the specified base URL
Sourcepub fn username(self, username: impl Into<String>) -> Self
pub fn username(self, username: impl Into<String>) -> Self
Set the username for basic authentication
Sourcepub fn password(self, password: impl Into<String>) -> Self
pub fn password(self, password: impl Into<String>) -> Self
Set the password for basic authentication
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
Set the maximum number of retries
Sourcepub fn custom_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn custom_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a custom header
Sourcepub fn custom_headers(self, headers: HashMap<String, String>) -> Self
pub fn custom_headers(self, headers: HashMap<String, String>) -> Self
Add multiple custom headers
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Set the user agent
Sourcepub fn build(self) -> Result<LatticeClient, ApiError>
pub fn build(self) -> Result<LatticeClient, ApiError>
Build the client with validation
Auto Trait Implementations§
impl Freeze for ApiClientBuilder
impl RefUnwindSafe for ApiClientBuilder
impl Send for ApiClientBuilder
impl Sync for ApiClientBuilder
impl Unpin for ApiClientBuilder
impl UnwindSafe for ApiClientBuilder
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