pub struct Client<S> { /* private fields */ }Expand description
A cloneable blocking boundary around an asynchronous HTTP service.
Implementations§
Source§impl<S> Client<S>
impl<S> Client<S>
Sourcepub fn try_new(service: S) -> Result<Self>
pub fn try_new(service: S) -> Result<Self>
Create a client with its own dedicated runtime thread.
Sourcepub fn with_runtime(service: S, runtime: &Runtime) -> Self
pub fn with_runtime(service: S, runtime: &Runtime) -> Self
Create a client using an explicitly supplied runtime.
Sourcepub fn clone_service(&self) -> Arc<S> ⓘ
pub fn clone_service(&self) -> Arc<S> ⓘ
Clone the shared asynchronous HTTP service.
Sourcepub fn get<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn get<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a GET request.
Sourcepub fn post<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn post<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a POST request.
Sourcepub fn put<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn put<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a PUT request.
Sourcepub fn patch<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn patch<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a PATCH request.
Sourcepub fn delete<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn delete<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a DELETE request.
Sourcepub fn head<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn head<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a HEAD request.
Sourcepub fn connect<B>(
&self,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn connect<B>( &self, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a CONNECT request.
Sourcepub fn request<B>(
&self,
method: Method,
url: impl IntoUrl,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn request<B>( &self, method: Method, url: impl IntoUrl, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start building a request.
Sourcepub fn build_from_request<B, RequestBody>(
&self,
request: Request<RequestBody>,
) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
pub fn build_from_request<B, RequestBody>( &self, request: Request<RequestBody>, ) -> BlockingRequestBuilder<'_, Self, HttpResponse<B>>
Start with an existing request.
Trait Implementations§
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§
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
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,
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
Source§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
Write
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
Write
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
Write
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
Write
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
Write
value to writer