Type Alias SyncPart

Source
pub type SyncPart<'a> = Part<SyncPartBody<'a>>;
Expand description

阻塞 Multipart 表单组件

Aliased Type§

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

Implementations§

Source§

impl<'a> SyncPart<'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 Read + 'a) -> Self

设置阻塞 Multipart 的请求体为输入流

Source

pub fn file_path<S: AsRef<OsStr> + ?Sized>(path: &S) -> IoResult<Self>

设置阻塞 Multipart 的请求体为文件