pub struct CommonUploadParam {
pub name: String,
pub data: CommonUploadData,
pub form_fields: Option<HashMap<String, String>>,
}Expand description
通用文件上传参数。
用于通用上传接口(WxService::upload)的参数载体。
Fields§
§name: String文件对应的接口参数名称(非文件名),如 media
data: CommonUploadData上传数据
form_fields: Option<HashMap<String, String>>额外的表单字段,用于在上传文件的同时提交其他表单数据。
例如上传视频素材时需要提交 description 字段(JSON 格式的视频描述信息)。
Implementations§
Source§impl CommonUploadParam
impl CommonUploadParam
Sourcepub fn new(name: impl Into<String>, data: CommonUploadData) -> Self
pub fn new(name: impl Into<String>, data: CommonUploadData) -> Self
Sourcepub fn with_form_fields(
name: impl Into<String>,
data: CommonUploadData,
form_fields: HashMap<String, String>,
) -> Self
pub fn with_form_fields( name: impl Into<String>, data: CommonUploadData, form_fields: HashMap<String, String>, ) -> Self
Trait Implementations§
Source§impl Clone for CommonUploadParam
impl Clone for CommonUploadParam
Source§fn clone(&self) -> CommonUploadParam
fn clone(&self) -> CommonUploadParam
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommonUploadParam
impl Debug for CommonUploadParam
Source§impl RequestExecutor<String, CommonUploadParam> for MediaUploadRequestExecutor
impl RequestExecutor<String, CommonUploadParam> for MediaUploadRequestExecutor
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
data: CommonUploadParam,
wx_type: WxType,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
data: CommonUploadParam,
wx_type: WxType,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行 HTTP 请求。 Read more
Auto Trait Implementations§
impl Freeze for CommonUploadParam
impl RefUnwindSafe for CommonUploadParam
impl Send for CommonUploadParam
impl Sync for CommonUploadParam
impl Unpin for CommonUploadParam
impl UnsafeUnpin for CommonUploadParam
impl UnwindSafe for CommonUploadParam
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