pub struct Client { /* private fields */ }Expand description
Shared configuration for product clients. Clones share the pool, session and limiter.
Implementations§
Source§impl Client
impl Client
pub fn builder(endpoint: Endpoint) -> ClientBuilder
pub fn limits(&self) -> &Limits
pub fn validation_limits(&self) -> Option<&ValidationLimits>
pub fn session(&self) -> Session
pub fn endpoint(&self) -> &Endpoint
Sourcepub fn oauth_context(&self) -> Option<&AuthContext>
pub fn oauth_context(&self) -> Option<&AuthContext>
Immutable OAuth identity, when this client uses a service-token provider.
Sourcepub fn with_endpoint(&self, endpoint: Endpoint) -> Result<Self>
pub fn with_endpoint(&self, endpoint: Endpoint) -> Result<Self>
Select an additional explicit endpoint without broadening destination admission. The new client shares authentication, transport, limits, cancellation, and permits.
Sourcepub fn with_tsg_header(&self, enabled: bool) -> Result<Self>
pub fn with_tsg_header(&self, enabled: bool) -> Result<Self>
Bind or omit the tenant routing header using the provider’s immutable identity. Product clients that require tenant routing enable it in their constructor.
Sourcepub async fn send_stream(
&self,
request: RawRequest,
options: Option<&RequestOptions>,
) -> Result<ResponseStream>
pub async fn send_stream( &self, request: RawRequest, options: Option<&RequestOptions>, ) -> Result<ResponseStream>
Start a caller-driven response body. Handshake includes queueing and OAuth; idle/session limits apply while reading. Only explicit runtime replay may retry a failed handshake; successful headers permanently end retry eligibility.
pub async fn send_bytes( &self, request: RawRequest, options: Option<&RequestOptions>, ) -> Result<Bytes>
Sourcepub async fn send_text(
&self,
request: RawRequest,
options: Option<&RequestOptions>,
) -> Result<String>
pub async fn send_text( &self, request: RawRequest, options: Option<&RequestOptions>, ) -> Result<String>
Read a bounded text response using UTF-8 replacement decoding, as Fetch does. A leading UTF-8 BOM is omitted; content-type does not select another encoding.