pub struct SerperHttpClient {
transport: HttpTransport,
api_key: ApiKey,
base_url: BaseUrl,
}
Expand description
High-level HTTP client for Serper API operations
This client handles authentication, request formatting, response parsing, and error handling for all Serper API interactions.
Fields§
§transport: HttpTransport
§api_key: ApiKey
§base_url: BaseUrl
Implementations§
Source§impl SerperHttpClient
impl SerperHttpClient
Sourcepub fn with_config(
api_key: ApiKey,
base_url: BaseUrl,
config: TransportConfig,
) -> Result<Self>
pub fn with_config( api_key: ApiKey, base_url: BaseUrl, config: TransportConfig, ) -> Result<Self>
Sourcepub async fn search(&self, query: &SearchQuery) -> Result<SearchResponse>
pub async fn search(&self, query: &SearchQuery) -> Result<SearchResponse>
Sourcepub async fn search_multiple(
&self,
queries: &[SearchQuery],
) -> Result<Vec<SearchResponse>>
pub async fn search_multiple( &self, queries: &[SearchQuery], ) -> Result<Vec<SearchResponse>>
Sourcepub async fn search_concurrent(
&self,
queries: &[SearchQuery],
max_concurrent: usize,
) -> Result<Vec<SearchResponse>>
pub async fn search_concurrent( &self, queries: &[SearchQuery], max_concurrent: usize, ) -> Result<Vec<SearchResponse>>
Sourcepub fn transport_config(&self) -> &TransportConfig
pub fn transport_config(&self) -> &TransportConfig
Gets the transport configuration
Sourcefn clone_for_concurrent(&self) -> Self
fn clone_for_concurrent(&self) -> Self
Helper method to clone the client for concurrent operations
This creates a new HTTP transport but reuses the API key and base URL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SerperHttpClient
impl !RefUnwindSafe for SerperHttpClient
impl Send for SerperHttpClient
impl Sync for SerperHttpClient
impl Unpin for SerperHttpClient
impl !UnwindSafe for SerperHttpClient
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