pub struct TokioAccessToken {
pub app_type: String,
pub app_id: String,
pub secret: String,
}Expand description
Access Token对象
Fields§
§app_type: String§app_id: String§secret: StringImplementations§
Source§impl TokioAccessToken
impl TokioAccessToken
Sourcepub async fn get_access_token(&self, grant_type: &str) -> Result<TokioToken>
pub async fn get_access_token(&self, grant_type: &str) -> Result<TokioToken>
获取微信授权的accessToken
Sourcepub async fn set(&mut self, val: TokioToken)
pub async fn set(&mut self, val: TokioToken)
把字符串对象写入缓存中,并指定有有效期单位秒
pub fn clear()
Sourcepub async fn get(&mut self) -> Option<TokioToken>
pub async fn get(&mut self) -> Option<TokioToken>
获取cache中的缓存数据
Trait Implementations§
Source§impl Clone for TokioAccessToken
impl Clone for TokioAccessToken
Source§fn clone(&self) -> TokioAccessToken
fn clone(&self) -> TokioAccessToken
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 moreSource§impl Debug for TokioAccessToken
impl Debug for TokioAccessToken
Source§impl Default for TokioAccessToken
impl Default for TokioAccessToken
Source§fn default() -> TokioAccessToken
fn default() -> TokioAccessToken
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TokioAccessToken
impl RefUnwindSafe for TokioAccessToken
impl Send for TokioAccessToken
impl Sync for TokioAccessToken
impl Unpin for TokioAccessToken
impl UnwindSafe for TokioAccessToken
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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