pub struct HttpAgentBuilder { /* private fields */ }Implementations§
Source§impl HttpAgentBuilder
impl HttpAgentBuilder
pub fn new() -> Self
Sourcepub fn with_url_str(self, url: &str) -> Result<Self, AgentError>
pub fn with_url_str(self, url: &str) -> Result<Self, AgentError>
Set the base URL from a string, returning Result for validation
Sourcepub fn with_headers(self, header_map: HeaderMap) -> Self
pub fn with_headers(self, header_map: HeaderMap) -> Self
Replace all headers with the provided HeaderMap
Sourcepub fn with_header(self, name: &str, value: &str) -> Result<Self, AgentError>
pub fn with_header(self, name: &str, value: &str) -> Result<Self, AgentError>
Add a single header by name and value strings
Sourcepub fn with_header_typed(self, name: HeaderName, value: HeaderValue) -> Self
pub fn with_header_typed(self, name: HeaderName, value: HeaderValue) -> Self
Add a header using HeaderName and HeaderValue directly
Sourcepub fn with_bearer_token(self, token: &str) -> Result<Self, AgentError>
pub fn with_bearer_token(self, token: &str) -> Result<Self, AgentError>
Add an authorization bearer token
Sourcepub fn with_http_client(self, client: HttpClient) -> Self
pub fn with_http_client(self, client: HttpClient) -> Self
Set a custom HTTP client
Sourcepub fn with_timeout(self, timeout_secs: u64) -> Self
pub fn with_timeout(self, timeout_secs: u64) -> Self
Set request timeout in seconds
pub fn build(self) -> Result<HttpAgent, AgentError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpAgentBuilder
impl !RefUnwindSafe for HttpAgentBuilder
impl Send for HttpAgentBuilder
impl Sync for HttpAgentBuilder
impl Unpin for HttpAgentBuilder
impl !UnwindSafe for HttpAgentBuilder
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