Skip to main content

Module client

Module client 

Source
Expand description

Per-call helpers used by the generated REST client.

The macro keeps emitted code small by funnelling the common “send unary request and decode the response” path through send_unary, and the streaming path through send_streaming.

Traits§

StreamRequestFactory
Builder for an SSE request that can be re-issued on reconnect.

Functions§

build_default_http_client
Non-otel build of build_default_http_client: RED metrics (.with_metrics) are NOT compiled in — that builder method only exists under toolkit-http/otel. client_type is unused in this configuration. .with_otel() is still called (see the doc on the otel-cfg sibling above): whether it actually propagates traceparent depends on whether toolkit-http/otel ends up enabled by some crate in the build, not on this crate’s own otel feature.
send_streaming
Send a streaming SSE request and adapt the response into a typed stream.
send_unary
Send a unary request and decode the JSON response.
with_json_body
Add a JSON body to a request builder. Wraps toolkit_http’s fallible .json() (which can fail to serialize) in our TransportError surface so the macro emit path can ? uniformly.