pub struct ReqwestTransport { /* private fields */ }Expand description
The real transport. Built once per client, not per request:
reqwest::Client owns the connection pool.
Implementations§
Source§impl ReqwestTransport
impl ReqwestTransport
pub fn new() -> Result<Self>
Sourcepub fn with_timeout(timeout: Duration) -> Result<Self>
pub fn with_timeout(timeout: Duration) -> Result<Self>
Like ReqwestTransport::new with a caller-chosen request
timeout - a language-model answer routinely outlasts the 30 s
that is right for a hosting API.
Sourcepub fn with_download_hosts(self, hosts: Vec<String>) -> Self
pub fn with_download_hosts(self, hosts: Vec<String>) -> Self
Lets HttpTransport::download fetch from hosts as well as the
GitHub release hosts (URLs or bare hosts; see
crate::updates::download_host_allowed_with).
Trait Implementations§
Source§impl HttpTransport for ReqwestTransport
impl HttpTransport for ReqwestTransport
Source§fn download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: HttpRequest,
progress: &'life1 Progress<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: HttpRequest,
progress: &'life1 Progress<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Streams the body chunk by chunk. Redirects are followed only to the
hosts crate::updates::download_host_allowed names (a release asset
redirects to GitHub’s CDN), and the first URL must be one of them too.
fn send<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for ReqwestTransport
impl !UnwindSafe for ReqwestTransport
impl Forget for ReqwestTransport
impl Freeze for ReqwestTransport
impl Move for ReqwestTransport
impl Send for ReqwestTransport
impl Sync for ReqwestTransport
impl Unpin for ReqwestTransport
impl UnsafeUnpin for ReqwestTransport
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