Type Alias AsyncPart

Source
pub type AsyncPart<'a> = Part<AsyncPartBody<'a>>;
Expand description

异步 Multipart 表单组件

Aliased Type§

struct AsyncPart<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> AsyncPart<'a>

Source

pub fn text(value: impl Into<Cow<'a, str>>) -> Self

设置异步 Multipart 的请求体为字符串

Source

pub fn bytes(value: impl Into<Cow<'a, [u8]>>) -> Self

设置异步 Multipart 的请求体为内存数据

Source

pub fn stream(value: impl AsyncRead + Send + Unpin + 'a) -> Self

设置异步 Multipart 的请求体为异步输入流

Source

pub async fn file_path<S: AsRef<OsStr> + ?Sized>( path: &S, ) -> IoResult<AsyncPart<'a>>

设置异步 Multipart 的请求体为文件