pub struct Client {
pub appid: String,
pub secret: String,
pub client: Client,
pub access_token: Option<AccessToken>,
}
Fields§
§appid: String
§secret: String
§client: Client
§access_token: Option<AccessToken>
Implementations§
Source§impl Client
impl Client
pub async fn code2session( &self, js_code: &str, ) -> Result<Code2Session, MiniProgramError>
pub async fn check_session_key( &self, open_id: &str, signature: &str, ) -> Result<(), MiniProgramError>
pub async fn reset_user_session_key( &self, open_id: &str, signature: &str, ) -> Result<SessionKey, MiniProgramError>
Source§impl Client
impl Client
pub async fn get_access_token(&self) -> Result<AccessToken, MiniProgramError>
pub async fn get_stable_access_token( &self, refresh: bool, ) -> Result<AccessToken, MiniProgramError>
Source§impl Client
impl Client
pub async fn crop_image( &self, path: &str, ) -> Result<CropImage, MiniProgramError>
pub async fn scan_qrcode( &self, path: &str, ) -> Result<ScanQrcode, MiniProgramError>
Source§impl Client
impl Client
pub async fn get_user_encrypt_key( &self, openid: &str, signature: &str, ) -> Result<Keys, MiniProgramError>
Source§impl Client
impl Client
pub async fn common_ocr(&self, path: &str) -> Result<CommOcr, MiniProgramError>
pub async fn driving(&self, path: &str) -> Result<Driving, MiniProgramError>
pub async fn bank_card(&self, path: &str) -> Result<BankCard, MiniProgramError>
pub async fn biz_license( &self, path: &str, ) -> Result<BizLicense, MiniProgramError>
pub async fn driving_license( &self, path: &str, ) -> Result<DrivingLicense, MiniProgramError>
pub async fn id_card(&self, path: &str) -> Result<IdCard, MiniProgramError>
Source§impl Client
impl Client
pub async fn clear_quota(&self) -> Result<(), MiniProgramError>
pub async fn clear_quota_by_app_secret(&self) -> Result<(), MiniProgramError>
pub async fn get_api_quota( &self, api_path: &str, ) -> Result<ApiQuota, MiniProgramError>
pub async fn get_rid_info(&self, rid: &str) -> Result<RidInfo, MiniProgramError>
Source§impl Client
impl Client
pub async fn get_user_phone_number( &self, code: &str, ) -> Result<PhoneInfo, MiniProgramError>
Source§impl Client
impl Client
pub async fn get_wxa_code( &self, request: &WxaCodeRequest, ) -> Result<WxaCode, MiniProgramError>
pub async fn get_wxa_code_unlimited( &self, request: &WxaCodeUnlimitedRequest, ) -> Result<WxaCode, MiniProgramError>
pub async fn create_wxa_qrcode( &self, request: &WxaQrcodeRequest, ) -> Result<WxaCode, MiniProgramError>
Source§impl Client
impl Client
pub async fn get_service_message_media( &self, media_id: &str, ) -> Result<Media, MiniProgramError>
pub async fn send_service_message_typing( &self, openid: &str, command: Command, ) -> Result<(), MiniProgramError>
pub async fn upload_media( &self, file_path: &str, ) -> Result<(), MiniProgramError>
pub async fn send_service_message( &self, request: &ServiceMessageRequest, ) -> Result<(), MiniProgramError>
Source§impl Client
impl Client
pub async fn generate_wxa_shortlink( &self, request: &GenerateWxaShortLinkRequest, ) -> Result<Shortlink, MiniProgramError>
Source§impl Client
impl Client
pub async fn delete_template( &self, template_id: &str, ) -> Result<(), MiniProgramError>
pub async fn get_category(&self) -> Result<GetCategory, MiniProgramError>
pub async fn get_pub_template_keywords( &self, template_id: &str, ) -> Result<GetPubTemplateKeywords, MiniProgramError>
pub async fn get_pub_template_titles( &self, category_ids: Vec<u32>, start: u32, limit: u8, ) -> Result<GetPubTemplateTitles, MiniProgramError>
pub async fn get_template(&self) -> Result<GetTemplate, MiniProgramError>
pub async fn send_subscribe_message( &self, request: &SendSubscribeMessageRequest, ) -> Result<(), MiniProgramError>
pub async fn add_template( &self, request: &AddTemplateRequest, ) -> Result<AddTemplate, MiniProgramError>
pub async fn set_user_notify( &self, request: &SetUserNotifyRequest, ) -> Result<(), MiniProgramError>
pub async fn set_user_notifytext( &self, request: &SetUserNotifyTextRequest, ) -> Result<(), MiniProgramError>
pub async fn get_user_notify( &self, request: &GetUserNotifyRequest, ) -> Result<GetUserNotify, MiniProgramError>
Source§impl Client
impl Client
pub async fn create_activity_id( &self, request: &CreateActivityIdRequest, ) -> Result<ActivityId, MiniProgramError>
pub async fn send_updatable_message( &self, request: &CreateActivityIdRequest, ) -> Result<(), MiniProgramError>
pub async fn send_chattool_message( &self, request: &ChattoolMessageRequest, ) -> Result<(), MiniProgramError>
Source§impl Client
impl Client
pub async fn generate_urllink( &self, request: &GenerateUrllinkRequest, ) -> Result<Urllink, MiniProgramError>
pub async fn query_urllink( &self, request: &QueryUrllinkRequest, ) -> Result<UrllinkQuery, MiniProgramError>
Source§impl Client
impl Client
pub async fn generate_scheme( &self, request: &GenerateSchemaRequest, ) -> Result<Scheme, MiniProgramError>
pub async fn query_scheme( &self, request: &QuerySchemaRequest, ) -> Result<SchemeQuery, MiniProgramError>
pub async fn generate_nfc_scheme( &self, request: &GenerateNfcSchemaRequest, ) -> Result<Scheme, MiniProgramError>
Source§impl Client
impl Client
pub async fn get_plugin_open_pid( &self, code: &str, ) -> Result<PluginOpenPid, MiniProgramError>
pub async fn check_encrypted_msg( &self, encrypted_msg_hash: &str, ) -> Result<CheckEncryptedMsg, MiniProgramError>
pub async fn get_paid_unionid_by_transaction( &self, openid: &str, transaction_id: &str, ) -> Result<PaidUnionid, MiniProgramError>
pub async fn get_paid_unionid_by_trade_no( &self, openid: &str, mch_id: &str, out_trade_no: &str, ) -> Result<PaidUnionid, MiniProgramError>
Trait Implementations§
Source§impl ClientTrait for Client
impl ClientTrait for Client
async fn access_token(&self) -> Result<String>
async fn refresh_access_token(&mut self) -> Result<()>
fn http_client(&self) -> &Client
fn url_with_query<I, K, V>( &self, url: &str, queries: I, ) -> Result<Url, WechatError>
fn get_empty<R, U>( &self, url: U, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn get<R, U, T>( &self, url: U, query: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn post_empty<R, U>( &self, url: U, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn post<R, U, T>( &self, url: U, data: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn upload<R, U>( &self, url: U, multipart: Form, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn upload_with<R, U, T>( &self, url: U, data: &T, multipart: Form, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn json<R, U, T>( &self, url: U, data: &T, ) -> impl Future<Output = Result<R, WechatError>> + Send
fn download<U, T>( &self, url: U, query: &T, ) -> impl Future<Output = Result<Vec<u8>, WechatError>> + Send
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more