pub struct StableTokenClient { /* private fields */ }Implementations§
Source§impl StableTokenClient
impl StableTokenClient
Sourcepub fn with_force_refresh(self, force_refresh: bool) -> Self
pub fn with_force_refresh(self, force_refresh: bool) -> Self
稳定版接口调用凭据有两种调用模式:
- 普通模式,access_token 有效期内重复调用该接口不会更新 access_token,绝大部分场景下使用该模式;
- 强制刷新模式,会导致上次获取的 access_token 失效,并返回新的 access_token;
默认使用普通模式,如果需要强制刷新,可调用此方法
use wechat_minapp::client::StableTokenClient;
let mut client = StableTokenClient::new("your_appid", "your_app_secret_here");
client.with_fore_refresh(true);Trait Implementations§
Source§impl Client for StableTokenClient
impl Client for StableTokenClient
Source§impl Clone for StableTokenClient
impl Clone for StableTokenClient
Source§fn clone(&self) -> StableTokenClient
fn clone(&self) -> StableTokenClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StableTokenClient
impl !RefUnwindSafe for StableTokenClient
impl Send for StableTokenClient
impl Sync for StableTokenClient
impl Unpin for StableTokenClient
impl !UnwindSafe for StableTokenClient
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