Struct conjure_runtime::Client [−][src]
pub struct Client<T = DefaultRawClient> { /* fields omitted */ }
An asynchronous HTTP client to a remote service.
It implements the Conjure AsyncClient trait, but also offers a “raw” request interface for use with services that
don’t provide Conjure service definitions.
Implementations
impl<T> Client<T>[src]
impl<T> Client<T>[src]pub fn request(
&self,
method: Method,
pattern: &'static str
) -> RequestBuilder<'_, T>[src]
&self,
method: Method,
pattern: &'static str
) -> RequestBuilder<'_, T>
Returns a new request builder.
The pattern argument is a template for the request path. The param method on the builder is used to fill
in the parameters in the pattern with dynamic values.
pub fn get(&self, pattern: &'static str) -> RequestBuilder<'_, T>[src]
Returns a new builder for a GET request.
pub fn post(&self, pattern: &'static str) -> RequestBuilder<'_, T>[src]
Returns a new builder for a POST request.
pub fn put(&self, pattern: &'static str) -> RequestBuilder<'_, T>[src]
Returns a new builder for a PUT request.
pub fn delete(&self, pattern: &'static str) -> RequestBuilder<'_, T>[src]
Returns a new builder for a DELETE request.
pub fn patch(&self, pattern: &'static str) -> RequestBuilder<'_, T>[src]
Returns a new builder for a PATCH request.
Trait Implementations
impl<T, B> AsyncClient for Client<T> where
T: Service<Request<RawBody>, Response = Response<B>> + 'static + Sync + Send,
T::Error: Into<Box<dyn Error + Sync + Send>>,
T::Future: Send,
B: Body<Data = Bytes> + 'static + Sync + Send,
B::Error: Into<Box<dyn Error + Sync + Send>>, [src]
impl<T, B> AsyncClient for Client<T> where
T: Service<Request<RawBody>, Response = Response<B>> + 'static + Sync + Send,
T::Error: Into<Box<dyn Error + Sync + Send>>,
T::Future: Send,
B: Body<Data = Bytes> + 'static + Sync + Send,
B::Error: Into<Box<dyn Error + Sync + Send>>, [src]type BinaryWriter = BodyWriter
The client’s binary request body writer type.
type BinaryBody = ResponseBody<B>
The client’s binary response body type.
fn request<'a, R, U>(
&'a self,
method: Method,
path: &'static str,
path_params: PathParams,
query_params: QueryParams,
headers: HeaderMap<HeaderValue>,
body: R,
response_visitor: U
) -> Pin<Box<dyn Future<Output = Result<U::Output, Error>> + Send + 'a>> where
R: AsyncRequestBody<'a, Self::BinaryWriter> + Send + 'a,
U: VisitResponse<Self::BinaryBody> + Send + 'a, [src]
&'a self,
method: Method,
path: &'static str,
path_params: PathParams,
query_params: QueryParams,
headers: HeaderMap<HeaderValue>,
body: R,
response_visitor: U
) -> Pin<Box<dyn Future<Output = Result<U::Output, Error>> + Send + 'a>> where
R: AsyncRequestBody<'a, Self::BinaryWriter> + Send + 'a,
U: VisitResponse<Self::BinaryBody> + Send + 'a,
Auto Trait Implementations
impl<T = DefaultRawClient> !RefUnwindSafe for Client<T>
impl<T = DefaultRawClient> !RefUnwindSafe for Client<T>impl<T = DefaultRawClient> !UnwindSafe for Client<T>
impl<T = DefaultRawClient> !UnwindSafe for Client<T>Blanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,