pub struct FetchHttpTransport { /* private fields */ }Expand description
HTTP transport that validates DNS, pins connections, and handles redirects.
Implementations§
Source§impl FetchHttpTransport
impl FetchHttpTransport
Sourcepub fn new(
config: FetchHttpConfig,
resolver: Arc<dyn FetchDnsResolver>,
http: ProviderHttpConfig,
) -> Self
pub fn new( config: FetchHttpConfig, resolver: Arc<dyn FetchDnsResolver>, http: ProviderHttpConfig, ) -> Self
Creates a transport with an injected resolver and shared HTTP policy.
Sourcepub const fn url_policy(&self) -> FetchUrlPolicy
pub const fn url_policy(&self) -> FetchUrlPolicy
Returns the URL policy enforced before every DNS lookup.
Sourcepub const fn config(&self) -> FetchHttpConfig
pub const fn config(&self) -> FetchHttpConfig
Returns the complete immutable transport policy used by cache isolation.
Sourcepub fn production(http: ProviderHttpConfig) -> Self
pub fn production(http: ProviderHttpConfig) -> Self
Creates the production transport using the Tokio system resolver.
Sourcepub async fn get(
&self,
url: &str,
cancellation: CancellationScope,
) -> Result<FetchHttpResponse, FetchProviderError>
pub async fn get( &self, url: &str, cancellation: CancellationScope, ) -> Result<FetchHttpResponse, FetchProviderError>
Executes one complete bounded GET request.
§Errors
Returns a stable secret-independent error for URL, DNS, peer, redirect, size, timeout, transport, and cancellation failures.
Trait Implementations§
Source§impl Clone for FetchHttpTransport
impl Clone for FetchHttpTransport
Auto Trait Implementations§
impl !Freeze for FetchHttpTransport
impl !RefUnwindSafe for FetchHttpTransport
impl !UnwindSafe for FetchHttpTransport
impl Send for FetchHttpTransport
impl Sync for FetchHttpTransport
impl Unpin for FetchHttpTransport
impl UnsafeUnpin for FetchHttpTransport
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