pub struct BytesRequestBuilder { /* private fields */ }Expand description
表示二进制响应请求构建器。
Implementations§
Source§impl BytesRequestBuilder
impl BytesRequestBuilder
Sourcepub fn body_value(self, body: impl Into<JsonPayload>) -> Self
pub fn body_value(self, body: impl Into<JsonPayload>) -> Self
设置 JSON 请求体。
Sourcepub fn provider_option(
self,
key: impl Into<String>,
value: impl Into<JsonPayload>,
) -> Self
pub fn provider_option( self, key: impl Into<String>, value: impl Into<JsonPayload>, ) -> Self
在 provider 对应的 provider_options 下追加字段。
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
覆盖最大重试次数。
Sourcepub fn cancellation_token(self, token: CancellationToken) -> Self
pub fn cancellation_token(self, token: CancellationToken) -> Self
设置取消令牌。
Sourcepub fn multipart_text(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn multipart_text( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
添加 Multipart 文本字段。
Sourcepub fn multipart_file(self, name: impl Into<String>, file: UploadSource) -> Self
pub fn multipart_file(self, name: impl Into<String>, file: UploadSource) -> Self
添加 Multipart 文件字段。
Sourcepub fn extra_body(
self,
key: impl Into<String>,
value: impl Into<JsonPayload>,
) -> Self
pub fn extra_body( self, key: impl Into<String>, value: impl Into<JsonPayload>, ) -> Self
在 JSON 根对象中追加字段。
Sourcepub async fn send_with_meta(self) -> Result<ApiResponse<Bytes>>
pub async fn send_with_meta(self) -> Result<ApiResponse<Bytes>>
Sourcepub async fn send_raw_sse(self) -> Result<RawSseStream>
pub async fn send_raw_sse(self) -> Result<RawSseStream>
Trait Implementations§
Source§impl Clone for BytesRequestBuilder
impl Clone for BytesRequestBuilder
Source§fn clone(&self) -> BytesRequestBuilder
fn clone(&self) -> BytesRequestBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BytesRequestBuilder
impl !RefUnwindSafe for BytesRequestBuilder
impl Send for BytesRequestBuilder
impl Sync for BytesRequestBuilder
impl Unpin for BytesRequestBuilder
impl UnsafeUnpin for BytesRequestBuilder
impl !UnwindSafe for BytesRequestBuilder
Blanket Implementations§
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