pub struct CurlActor<H>{ /* private fields */ }Implementations§
Source§impl<H> CurlActor<H>
impl<H> CurlActor<H>
Sourcepub fn new() -> Self
pub fn new() -> Self
This creates the new instance of CurlActor to handle Curl perform asynchronously using Curl Multi in a background thread to avoid blocking of other tasks.
Sourcepub fn new_runtime(runtime: Runtime) -> Self
pub fn new_runtime(runtime: Runtime) -> Self
This creates the new instance of CurlActor to handle Curl perform asynchronously using Curl Multi in a background thread to avoid blocking of other tasks. The user can provide a custom runtime to use for the background task.
Sourcepub fn new_runtime_with_capacity(runtime: Runtime, capacity: usize) -> Self
pub fn new_runtime_with_capacity(runtime: Runtime, capacity: usize) -> Self
Create a new CurlActor with a user-provided runtime and configurable channel capacity.
Trait Implementations§
Source§impl<H> Actor<H> for CurlActor<H>
impl<H> Actor<H> for CurlActor<H>
Source§fn send_request<'life0, 'async_trait>(
&'life0 self,
easy2: Easy2<H>,
) -> Pin<Box<dyn Future<Output = Result<Easy2<H>, Error<H>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_request<'life0, 'async_trait>(
&'life0 self,
easy2: Easy2<H>,
) -> Pin<Box<dyn Future<Output = Result<Easy2<H>, Error<H>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
This will send Easy2 into the background task that will perform curl asynchronously, await the response in the oneshot receiver and return Easy2 back to the caller. This uses the curl multi interface to perform the request.
Source§fn perform_easy2<'life0, 'async_trait>(
&'life0 self,
easy2: Easy2<H>,
) -> Pin<Box<dyn Future<Output = Result<Easy2<H>, Error<H>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn perform_easy2<'life0, 'async_trait>(
&'life0 self,
easy2: Easy2<H>,
) -> Pin<Box<dyn Future<Output = Result<Easy2<H>, Error<H>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
This will send Easy2 into the background task that will perform curl asynchronously, await the response in the oneshot receiver and return Easy2 back to the caller. This uses the curl easy2 interface to perform the request.