pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool for managing HTTP connections
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub fn new(client: Client, retries: usize, max_backoff: Duration) -> Self
pub fn new(client: Client, retries: usize, max_backoff: Duration) -> Self
Create a new connection pool with custom settings
Sourcepub fn optimized() -> Self
pub fn optimized() -> Self
Create a connection pool with optimized settings for the VK Teams Bot API
Sourcepub async fn execute_with_retry<F, Fut, T>(&self, operation: F) -> Result<T>
pub async fn execute_with_retry<F, Fut, T>(&self, operation: F) -> Result<T>
Execute a request with exponential backoff retry strategy
Sourcepub async fn get_text(&self, url: Url) -> Result<String>
pub async fn get_text(&self, url: Url) -> Result<String>
Get text response from API with retry capability
Sourcepub async fn get_bytes(&self, url: Url) -> Result<Vec<u8>>
pub async fn get_bytes(&self, url: Url) -> Result<Vec<u8>>
Get bytes response from API with retry capability
Sourcepub async fn post_file_retryable(
&self,
url: Url,
retryable_form: &RetryableMultipartForm,
) -> Result<String>
pub async fn post_file_retryable( &self, url: Url, retryable_form: &RetryableMultipartForm, ) -> Result<String>
Post file to API with retry capability using retryable form
Trait Implementations§
Source§impl Clone for ConnectionPool
impl Clone for ConnectionPool
Source§fn clone(&self) -> ConnectionPool
fn clone(&self) -> ConnectionPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectionPool
impl Debug for ConnectionPool
Auto Trait Implementations§
impl Freeze for ConnectionPool
impl !RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl !UnwindSafe for ConnectionPool
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