pub struct HttpEngineLocal<R, C> { /* private fields */ }Expand description
HTTP client for completion-based runtimes (compio).
Wraps HttpEngineCore with a !Send-capable connector.
Implementations§
Source§impl<R: RuntimeLocal, C: ConnectorLocal + Clone + Default> HttpEngineLocal<R, C>
impl<R: RuntimeLocal, C: ConnectorLocal + Clone + Default> HttpEngineLocal<R, C>
Sourcepub fn builder() -> HttpEngineBuilder<R, C>
pub fn builder() -> HttpEngineBuilder<R, C>
Create a new HttpEngineBuilder for a completion-based runtime.
Sourcepub fn with_rustls() -> Self
pub fn with_rustls() -> Self
Create a client with rustls TLS for a completion-based runtime.
Source§impl<R: RuntimeLocal, C: ConnectorLocal + Clone> HttpEngineLocal<R, C>
impl<R: RuntimeLocal, C: ConnectorLocal + Clone> HttpEngineLocal<R, C>
Sourcepub fn builder_with_connector(connector: C) -> HttpEngineBuilder<R, C>
pub fn builder_with_connector(connector: C) -> HttpEngineBuilder<R, C>
Create a new HttpEngineBuilder with a specific connector for a completion-based runtime.
Sourcepub fn with_connector(connector: C) -> Self
pub fn with_connector(connector: C) -> Self
Create a new client with default settings and a specific connector.
Sourcepub fn with_rustls_connector(connector: C) -> Self
pub fn with_rustls_connector(connector: C) -> Self
Create a client with rustls TLS and a specific connector for a completion-based runtime.
Sourcepub fn get_local(
&self,
uri: &str,
) -> Result<RequestBuilderLocal<'_, R, C>, Error>
pub fn get_local( &self, uri: &str, ) -> Result<RequestBuilderLocal<'_, R, C>, Error>
Start a GET request to the given URL.
Sourcepub fn post_local(
&self,
uri: &str,
) -> Result<RequestBuilderLocal<'_, R, C>, Error>
pub fn post_local( &self, uri: &str, ) -> Result<RequestBuilderLocal<'_, R, C>, Error>
Start a POST request to the given URL.
Sourcepub fn request_local(
&self,
method: Method,
uri: &str,
) -> Result<RequestBuilderLocal<'_, R, C>, Error>
pub fn request_local( &self, method: Method, uri: &str, ) -> Result<RequestBuilderLocal<'_, R, C>, Error>
Start a request with the given method and URL.
Sourcepub fn chunk_download_local(&self, url: &str) -> ChunkDownloadLocal<R, C>
pub fn chunk_download_local(&self, url: &str) -> ChunkDownloadLocal<R, C>
Start a parallel chunk download for the given URL.
Sourcepub async fn resolve_all(
&self,
host: &str,
port: u16,
) -> Result<Vec<SocketAddr>, Error>
pub async fn resolve_all( &self, host: &str, port: u16, ) -> Result<Vec<SocketAddr>, Error>
Resolve a hostname to all socket addresses using the configured DNS resolver.
Returns every address the resolver provides. This enables service discovery
and custom load-balancing: resolve once, select an address with your
strategy (round-robin, least-connections, consistent hashing), then send the
request to the chosen address via
crate::RequestBuilderLocal::force_addr.
For a host that is already an IP literal, this returns a single-element vec without consulting any resolver.
Source§impl<R, C> HttpEngineLocal<R, C>
impl<R, C> HttpEngineLocal<R, C>
Sourcepub fn pool_stats(&self) -> PoolStats
pub fn pool_stats(&self) -> PoolStats
Take a snapshot of connection pool statistics.
Trait Implementations§
Source§impl<R, C: Clone> Clone for HttpEngineLocal<R, C>
impl<R, C: Clone> Clone for HttpEngineLocal<R, C>
Source§impl<R, C> Debug for HttpEngineLocal<R, C>
impl<R, C> Debug for HttpEngineLocal<R, C>
Source§impl<R: RuntimeLocal, C: ConnectorLocal + Clone + Default> Default for HttpEngineLocal<R, C>
impl<R: RuntimeLocal, C: ConnectorLocal + Clone + Default> Default for HttpEngineLocal<R, C>
Source§impl<R: RuntimeLocal, C: ConnectorLocal + Clone> HttpClient for HttpEngineLocal<R, C>
impl<R: RuntimeLocal, C: ConnectorLocal + Clone> HttpClient for HttpEngineLocal<R, C>
Source§type RequestBuilder = OwnedRequestBuilderLocal<R, C>
type RequestBuilder = OwnedRequestBuilderLocal<R, C>
request().Auto Trait Implementations§
impl<R, C> !Freeze for HttpEngineLocal<R, C>
impl<R, C> !RefUnwindSafe for HttpEngineLocal<R, C>
impl<R, C> !Send for HttpEngineLocal<R, C>
impl<R, C> !Sync for HttpEngineLocal<R, C>
impl<R, C> !UnwindSafe for HttpEngineLocal<R, C>
impl<R, C> Unpin for HttpEngineLocal<R, C>
impl<R, C> UnsafeUnpin for HttpEngineLocal<R, C>where
C: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more