Skip to main content

WxOpenDefaultConfig

Struct WxOpenDefaultConfig 

Source
pub struct WxOpenDefaultConfig { /* private fields */ }
Expand description

开放平台默认配置存储(内存实现)。

Implementations§

Source§

impl WxOpenDefaultConfig

Source

pub fn new() -> Self

构建默认配置(Java 以无参构造 + setter 装配,Rust 提供同名语义的 便捷构造;字段默认 None/0/1000/5,与 Java 字段默认值一致)。

Source

pub fn set_component_app_id(&mut self, v: impl Into<String>) -> &mut Self

设置第三方平台 appid。

Source

pub fn set_component_app_secret(&mut self, v: impl Into<String>) -> &mut Self

设置第三方平台 appsecret。

Source

pub fn set_component_token(&mut self, v: impl Into<String>) -> &mut Self

设置消息校验 Token。

Source

pub fn set_component_aes_key(&mut self, v: impl Into<String>) -> &mut Self

设置消息加解密 Key。

Source

pub fn set_component_verify_ticket(&mut self, v: impl Into<String>) -> &mut Self

设置推送的 verify ticket。

Source

pub fn set_http_proxy_host(&mut self, v: impl Into<String>) -> &mut Self

设置 HTTP 代理主机。

Source

pub fn set_http_proxy_port(&mut self, v: i32) -> &mut Self

设置 HTTP 代理端口。

Source

pub fn set_http_proxy_username(&mut self, v: impl Into<String>) -> &mut Self

设置 HTTP 代理用户名。

Source

pub fn set_http_proxy_password(&mut self, v: impl Into<String>) -> &mut Self

设置 HTTP 代理密码。

Source

pub fn set_retry_sleep_millis(&mut self, v: i32) -> &mut Self

设置 HTTP 请求重试间隔(毫秒)。

Source

pub fn set_max_retry_times(&mut self, v: i32) -> &mut Self

设置 HTTP 请求最大重试次数。

Source

pub fn set_api_host_url(&mut self, v: impl Into<String>) -> &mut Self

设置自定义 API 主机地址(对应 Java setApiHostUrl(String))。

Source

pub fn set_access_token_url(&mut self, v: impl Into<String>) -> &mut Self

设置自定义获取 accessToken 地址(对应 Java setAccessTokenUrl(String))。

Source

pub fn api_host_url(&self) -> Option<String>

自定义 API 主机地址(对应 Java getApiHostUrl())。

Source

pub fn access_token_url(&self) -> Option<String>

自定义获取 accessToken 地址(对应 Java getAccessTokenUrl())。

Source

pub fn effective_api_host_url(&self) -> String

根据配置获取实际应使用的 API 主机地址(对应 Java getEffectiveApiHostUrl():自定义 apiHostUrl 优先,否则默认 https://api.weixin.qq.com)。

Trait Implementations§

Source§

impl Debug for WxOpenDefaultConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WxOpenDefaultConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl WxOpenConfigStorage for WxOpenDefaultConfig

Source§

fn component_app_id(&self) -> Option<String>

第三方平台 appid(对应 Java getComponentAppId())。
Source§

fn set_component_app_id(&self, component_app_id: &str)

设置第三方平台 appid(对应 Java setComponentAppId(String))。
Source§

fn component_app_secret(&self) -> Option<String>

第三方平台 appsecret(对应 Java getComponentAppSecret())。
Source§

fn set_component_app_secret(&self, component_app_secret: &str)

设置第三方平台 appsecret(对应 Java setComponentAppSecret(String))。
Source§

fn component_token(&self) -> Option<String>

消息校验 Token(对应 Java getComponentToken())。
Source§

fn set_component_token(&self, component_token: &str)

设置消息校验 Token(对应 Java setComponentToken(String))。
Source§

fn component_aes_key(&self) -> Option<String>

消息加解密 Key(对应 Java getComponentAesKey())。
Source§

fn set_component_aes_key(&self, component_aes_key: &str)

设置消息加解密 Key(对应 Java setComponentAesKey(String))。
Source§

fn component_verify_ticket(&self) -> Option<String>

推送的 verify ticket(对应 Java getComponentVerifyTicket())。
Source§

fn set_component_verify_ticket(&self, component_verify_ticket: &str)

设置推送的 verify ticket(对应 Java setComponentVerifyTicket(String))。
Source§

fn component_access_token(&self) -> Option<String>

当前缓存的 component_access_token(对应 Java getComponentAccessToken())。
Source§

fn is_component_access_token_expired(&self) -> bool

component_access_token 是否已过期(对应 Java isComponentAccessTokenExpired())。
Source§

fn expire_component_access_token(&self)

强制将 component_access_token 过期(对应 Java expireComponentAccessToken())。
Source§

fn update_component_access_token_with_expiry( &self, component_access_token: &str, expires_in_seconds: i32, )

线程安全地更新 component_access_token(对应 Java updateComponentAccessToken(String, int) 重载)。
Source§

fn component_access_token_lock(&self) -> Arc<AsyncMutex<()>>

component_access_token 锁(对应 Java getComponentAccessTokenLock())。
Source§

fn lock_by_key(&self, key: &str) -> Arc<AsyncMutex<()>>

按 key 取锁(对应 Java getLockByKey(String),并发仅刷新一次语义)。
Source§

fn wx_open_host_config(&self) -> Option<WxOpenHostConfig>

自定义域名配置(对应 mp/ma 的 host config 语义)。 Read more
Source§

fn authorizer_refresh_token(&self, app_id: &str) -> Option<String>

授权方 refresh_token(对应 Java getAuthorizerRefreshToken(String))。
Source§

fn set_authorizer_refresh_token( &self, app_id: &str, authorizer_refresh_token: &str, )

设置授权方 refresh_token(对应 Java setAuthorizerRefreshToken(String, String))。
Source§

fn authorizer_access_token(&self, app_id: &str) -> Option<String>

授权方 access_token(对应 Java getAuthorizerAccessToken(String))。
Source§

fn is_authorizer_access_token_expired(&self, app_id: &str) -> bool

授权方 access_token 是否过期(对应 Java isAuthorizerAccessTokenExpired(String))。
Source§

fn expire_authorizer_access_token(&self, app_id: &str)

强制将授权方 access_token 过期(对应 Java expireAuthorizerAccessToken(String))。
Source§

fn update_authorizer_access_token_with_expiry( &self, app_id: &str, authorizer_access_token: &str, expires_in_seconds: i32, )

线程安全地更新授权方 access_token(对应 Java updateAuthorizerAccessToken(String, String, int) 重载)。
Source§

fn jsapi_ticket(&self, app_id: &str) -> Option<String>

授权方 jsapi ticket(对应 Java getJsapiTicket(String))。
Source§

fn is_jsapi_ticket_expired(&self, app_id: &str) -> bool

授权方 jsapi ticket 是否过期(对应 Java isJsapiTicketExpired(String))。
Source§

fn expire_jsapi_ticket(&self, app_id: &str)

强制将授权方 jsapi ticket 过期(对应 Java expireJsapiTicket(String))。
Source§

fn update_jsapi_ticket( &self, app_id: &str, jsapi_ticket: &str, expires_in_seconds: i32, )

线程安全地更新授权方 jsapi ticket(对应 Java updateJsapiTicket(String, String, int))。
Source§

fn card_api_ticket(&self, app_id: &str) -> Option<String>

授权方卡券 api ticket(对应 Java getCardApiTicket(String))。
Source§

fn is_card_api_ticket_expired(&self, app_id: &str) -> bool

授权方卡券 api ticket 是否过期(对应 Java isCardApiTicketExpired(String))。
Source§

fn expire_card_api_ticket(&self, app_id: &str)

强制将授权方卡券 api ticket 过期(对应 Java expireCardApiTicket(String))。
Source§

fn update_card_api_ticket( &self, app_id: &str, card_api_ticket: &str, expires_in_seconds: i32, )

线程安全地更新授权方卡券 api ticket(对应 Java updateCardApiTicket(String, String, int))。
Source§

fn http_proxy_host(&self) -> Option<String>

HTTP 代理主机(对应 Java getHttpProxyHost())。
Source§

fn http_proxy_port(&self) -> i32

HTTP 代理端口(对应 Java getHttpProxyPort())。
Source§

fn http_proxy_username(&self) -> Option<String>

HTTP 代理用户名(对应 Java getHttpProxyUsername())。
Source§

fn http_proxy_password(&self) -> Option<String>

HTTP 代理密码(对应 Java getHttpProxyPassword())。
Source§

fn retry_sleep_millis(&self) -> i32

HTTP 请求重试间隔(毫秒,对应 Java getRetrySleepMillis(),默认 1000)。
Source§

fn max_retry_times(&self) -> i32

HTTP 请求最大重试次数(对应 Java getMaxRetryTimes(),默认 5)。
Source§

fn component_api_signature_rsa_private_key(&self) -> Option<String>

第三方平台设置 API 签名 RSA 私钥(对应 Java getComponentApiSignatureRsaPrivateKey())。
Source§

fn set_component_api_signature_rsa_private_key( &self, api_signature_rsa_private_key: &str, )

设置 API 签名 RSA 私钥(对应 Java setComponentApiSignatureRsaPrivateKey(String))。
Source§

fn component_api_signature_aes_key(&self) -> Option<String>

API 签名 AES KEY(对应 Java getComponentApiSignatureAesKey())。
Source§

fn set_component_api_signature_aes_key(&self, api_signature_aes_key: &str)

设置 API 签名 AES KEY(对应 Java setComponentApiSignatureAesKey(String))。
Source§

fn component_api_signature_rsa_private_key_sn(&self) -> Option<String>

API 签名 RSA 私钥序号(对应 Java getComponentApiSignatureRsaPrivateKeySn())。
Source§

fn set_component_api_signature_rsa_private_key_sn( &self, api_signature_rsa_private_key_sn: &str, )

设置 API 签名 RSA 私钥序号(对应 Java setComponentApiSignatureRsaPrivateKeySn(String))。
Source§

fn component_api_signature_aes_key_sn(&self) -> Option<String>

API 签名 AES key 序号(对应 Java getComponentApiSignatureAesKeySn())。
Source§

fn set_component_api_signature_aes_key_sn(&self, api_signature_aes_key_sn: &str)

设置 API 签名 AES key 序号(对应 Java setComponentApiSignatureAesKeySn(String))。
Source§

fn set_wx_open_info( &self, component_app_id: &str, component_app_secret: &str, component_token: &str, component_aes_key: &str, )

设置第三方平台基础信息(对应 Java setWxOpenInfo 四参便捷方法)。
Source§

fn update_component_access_token( &self, component_access_token: &WxOpenComponentAccessToken, )

线程安全地更新 component_access_token(对应 Java updateComponentAccessToken(WxOpenComponentAccessToken))。
Source§

fn auto_refresh_token(&self) -> bool

token 过期时是否自动刷新(对应 Java autoRefreshToken(),默认 true)。
Source§

fn update_authorizer_refresh_token( &self, app_id: &str, authorizer_refresh_token: &str, )

更新授权方 refresh_token(对应 Java updateAuthorizerRefreshToken(String, String) 重载方法,Java 语义与 set 相同)。
Source§

fn update_authorizer_access_token( &self, app_id: &str, authorizer_access_token: &WxOpenAuthorizerAccessToken, )

线程安全地更新授权方 access_token(对应 Java updateAuthorizerAccessToken(String, WxOpenAuthorizerAccessToken))。
Source§

fn wx_mp_config_storage( &self, _app_id: &str, ) -> Option<Arc<dyn WxConfigStorage>>

按 appId 取代公众号配置存储(对应 Java getWxMpConfigStorage(String))。 Read more
Source§

fn wx_ma_config(&self, _app_id: &str) -> Option<Arc<dyn WxConfigStorage>>

按 appId 取代小程序配置存储(对应 Java getWxMaConfig(String))。 Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more