pub struct GoogleOAuthTokenManager { /* private fields */ }Implementations§
Source§impl GoogleOAuthTokenManager
impl GoogleOAuthTokenManager
pub fn new() -> Self
Sourcepub async fn refresh_access_token(
&self,
connection_id: ExternalConnectionId,
config: &GoogleOAuthConfig,
refresh_token: &str,
) -> Result<String, GoogleOAuthError>
pub async fn refresh_access_token( &self, connection_id: ExternalConnectionId, config: &GoogleOAuthConfig, refresh_token: &str, ) -> Result<String, GoogleOAuthError>
Return a valid access token, refreshing at most once concurrently for a given connection. A changed refresh token invalidates the cached token.
Sourcepub async fn invalidate(&self, connection_id: ExternalConnectionId)
pub async fn invalidate(&self, connection_id: ExternalConnectionId)
Invalidate cached access tokens after disconnect or reauthorization. The per-connection lock is retained so invalidation cannot race a refresh.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GoogleOAuthTokenManager
impl !RefUnwindSafe for GoogleOAuthTokenManager
impl !UnwindSafe for GoogleOAuthTokenManager
impl Send for GoogleOAuthTokenManager
impl Sync for GoogleOAuthTokenManager
impl Unpin for GoogleOAuthTokenManager
impl UnsafeUnpin for GoogleOAuthTokenManager
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