Struct BlockingHttpClient
pub struct BlockingHttpClient<S> { /* private fields */ }Available on crate features
dns and http-backend and http and std and tcp only.Expand description
A cloneable blocking boundary around an asynchronous HTTP service.
Implementations§
§impl<S> Client<S>
impl<S> Client<S>
pub fn try_new(service: S) -> Result<Client<S>, Error>
pub fn try_new(service: S) -> Result<Client<S>, Error>
Create a client with its own dedicated runtime thread.
pub fn with_runtime(service: S, runtime: &Runtime) -> Client<S>
pub fn with_runtime(service: S, runtime: &Runtime) -> Client<S>
Create a client using an explicitly supplied runtime.
pub fn clone_service(&self) -> Arc<S> ⓘ
pub fn clone_service(&self) -> Arc<S> ⓘ
Clone the shared asynchronous HTTP service.
pub fn get<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn get<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a GET request.
pub fn post<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn post<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a POST request.
pub fn put<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn put<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a PUT request.
pub fn patch<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn patch<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a PATCH request.
pub fn delete<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn delete<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a DELETE request.
pub fn head<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn head<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a HEAD request.
pub fn connect<B>(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn connect<B>( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a CONNECT request.
pub fn request<B>(
&self,
method: Method,
url: impl IntoUrl,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn request<B>( &self, method: Method, url: impl IntoUrl, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start building a request.
pub fn build_from_request<B, RequestBody>(
&self,
request: Request<RequestBody>,
) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
pub fn build_from_request<B, RequestBody>( &self, request: Request<RequestBody>, ) -> RequestBuilder<'_, Client<S>, Response<B>, Blocking>
Start with an existing request.
Trait Implementations§
§impl<S, Body> BlockingHttpClientWebSocketExt<Body> for Client<S>
impl<S, Body> BlockingHttpClientWebSocketExt<Body> for Client<S>
§type AsyncService = S
type AsyncService = S
The asynchronous service wrapped by this blocking HTTP client.
§fn websocket(
&self,
url: impl IntoUrl,
) -> WebSocketRequestBuilder<WithService<'_, <Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService, Body, Blocking<<Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService>>>
fn websocket( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, <Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService, Body, Blocking<<Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService>>>
Create a WebSocket request builder for an HTTP/1.1 upgrade.
§fn websocket_h2(
&self,
url: impl IntoUrl,
) -> WebSocketRequestBuilder<WithService<'_, <Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService, Body, Blocking<<Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService>>>
fn websocket_h2( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, <Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService, Body, Blocking<<Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService>>>
Create a WebSocket request builder for HTTP/2 Extended CONNECT.
§fn websocket_with_request<RequestBody>(
&self,
request: Request<RequestBody>,
) -> WebSocketRequestBuilder<WithService<'_, <Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService, Body, Blocking<<Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService>>>
fn websocket_with_request<RequestBody>( &self, request: Request<RequestBody>, ) -> WebSocketRequestBuilder<WithService<'_, <Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService, Body, Blocking<<Client<S> as BlockingHttpClientWebSocketExt<Body>>::AsyncService>>>
Create a WebSocket request builder from an existing request.
§impl<S, B> BlockingService<Request> for Client<S>
impl<S, B> BlockingService<Request> for Client<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Client<S>
impl<S> !UnwindSafe for Client<S>
impl<S> Freeze for Client<S>
impl<S> Send for Client<S>
impl<S> Sync for Client<S>
impl<S> Unpin for Client<S>
impl<S> UnsafeUnpin for Client<S>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more