pub struct WxOpenServiceImpl { /* private fields */ }Expand description
开放平台服务实现(reqwest HTTP 后端)。
Implementations§
Trait Implementations§
Source§impl WxOpenService for WxOpenServiceImpl
impl WxOpenService for WxOpenServiceImpl
Source§fn upload_minishop_media_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
file_path: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<WxMinishopImageUploadResult, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload_minishop_media_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
file_path: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<WxMinishopImageUploadResult, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
上传图片到小程序/开放平台素材库(对应 Java
uploadMinishopMediaFile(String url, File file))。
Wave 2 实现:经 MinishopUploadRequestExecutor(reqwest multipart,
字段名 media,对应 Java MinishopUploadRequestExecutor);
ADAPTED:Java File 入参 → Rust 文件路径字符串。
Source§fn wx_open_component_service(&self) -> Option<Arc<dyn WxOpenComponentService>>
fn wx_open_component_service(&self) -> Option<Arc<dyn WxOpenComponentService>>
组件子服务(对应 Java
getWxOpenComponentService())。 Read moreSource§fn wx_open_config_storage(&self) -> Arc<dyn WxOpenConfigStorage> ⓘ
fn wx_open_config_storage(&self) -> Arc<dyn WxOpenConfigStorage> ⓘ
配置存储(对应 Java
getWxOpenConfigStorage())。Source§fn set_wx_open_config_storage(
&self,
wx_open_config_storage: Arc<dyn WxOpenConfigStorage>,
)
fn set_wx_open_config_storage( &self, wx_open_config_storage: Arc<dyn WxOpenConfigStorage>, )
设置配置存储(对应 Java
setWxOpenConfigStorage(WxOpenConfigStorage))。Source§fn http_client(&self) -> &Client
fn http_client(&self) -> &Client
HTTP 客户端(对应 Java
RequestHttp.getRequestHttpClient())。Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
query_param: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
query_param: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
GET 请求(对应 Java
get(String, String))。 Read moreSource§fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
post_data: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn post<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
url: &'life1 str,
post_data: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
POST 请求(对应 Java
post(String, String))。 Read moreSource§fn get_component_access_token<'life0, 'async_trait>(
&'life0 self,
force_refresh: bool,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_component_access_token<'life0, 'async_trait>(
&'life0 self,
force_refresh: bool,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取 component_access_token(对应 Java
WxOpenComponentService.getComponentAccessToken(boolean),
开放平台接口调用凭据)。Source§fn get_pre_auth_code<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pre_auth_code<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取预授权码(对应 Java
WxOpenComponentServiceImpl.createPreAuthUrl
内部 POST API_CREATE_PREAUTHCODE_URL 的 pre_auth_code 字段)。Source§fn get_pre_auth_url<'life0, 'life1, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_pre_auth_url<'life0, 'life1, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
获取网页授权预授权链接(对应 Java
WxOpenComponentService.getPreAuthUrl(String))。Source§fn get_pre_auth_url_with<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
auth_type: Option<&'life2 str>,
biz_appid: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_pre_auth_url_with<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
auth_type: Option<&'life2 str>,
biz_appid: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
获取网页授权预授权链接(对应 Java
WxOpenComponentService.getPreAuthUrl(String, String, String))。Source§fn get_mobile_pre_auth_url<'life0, 'life1, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_mobile_pre_auth_url<'life0, 'life1, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
获取移动端预授权链接(对应 Java
WxOpenComponentService.getMobilePreAuthUrl(String))。Source§fn get_mobile_pre_auth_url_with<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
auth_type: Option<&'life2 str>,
biz_appid: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_mobile_pre_auth_url_with<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
redirect_uri: &'life1 str,
auth_type: Option<&'life2 str>,
biz_appid: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
获取移动端预授权链接(对应 Java
WxOpenComponentService.getMobilePreAuthUrl(String, String, String))。获取(刷新)授权方 access_token(对应 Java
WxOpenComponentService.getAuthorizerAccessToken(String, boolean),
三方 token 刷新:component_access_token + authorizer refresh_token
换新 token)。Source§fn route<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 WxOpenXmlMessage,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn route<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 WxOpenXmlMessage,
) -> Pin<Box<dyn Future<Output = Result<String, WxErrorException>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
路由第三方平台推送的加密回调消息(对应 Java
WxOpenComponentService.route(WxOpenXmlMessage),POST 回调消息
解密 + 分发)。 Read moreAuto Trait Implementations§
impl !Freeze for WxOpenServiceImpl
impl !RefUnwindSafe for WxOpenServiceImpl
impl !UnwindSafe for WxOpenServiceImpl
impl Send for WxOpenServiceImpl
impl Sync for WxOpenServiceImpl
impl Unpin for WxOpenServiceImpl
impl UnsafeUnpin for WxOpenServiceImpl
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