pub struct ProfileTokenProvider { /* private fields */ }Expand description
Profile-driven OAuth refresh.
Implementations§
Source§impl ProfileTokenProvider
impl ProfileTokenProvider
Sourcepub fn without_http_refresh(&self)
pub fn without_http_refresh(&self)
Skip the token-URL POST on later TokenProvider::get_token calls.
Hosts that want a cheap “cached oat only” probe use this.
Source§impl ProfileTokenProvider
impl ProfileTokenProvider
Sourcepub async fn offline_block(&self) -> Option<String>
pub async fn offline_block(&self) -> Option<String>
A local reason get_token would fail without contacting the token URL.
Status uses this so an expired access token with no refresh token is not reported as available. A token that can still be refreshed is not a block: refresh needs the network, and status does not call it.
Trait Implementations§
Source§impl Clone for ProfileTokenProvider
impl Clone for ProfileTokenProvider
Source§impl Debug for ProfileTokenProvider
impl Debug for ProfileTokenProvider
Source§impl From<ProfileTokenProvider> for AnyTokenProvider
Available on crate feature net only.
impl From<ProfileTokenProvider> for AnyTokenProvider
Available on crate feature
net only.Source§fn from(t: ProfileTokenProvider) -> Self
fn from(t: ProfileTokenProvider) -> Self
Converts to this type from the input type.
Source§impl TokenProvider for ProfileTokenProvider
impl TokenProvider for ProfileTokenProvider
Source§fn mark_stale(&self)
fn mark_stale(&self)
Drop the cached token so the next
TokenProvider::get_token refreshes.Source§async fn get_token(&self) -> Result<String, AuthError>
async fn get_token(&self) -> Result<String, AuthError>
Return a valid access token, refreshing if necessary.
Source§fn wake(&self)
fn wake(&self)
Host laptop-wake hook. Default calls
TokenProvider::mark_stale.Auto Trait Implementations§
impl !RefUnwindSafe for ProfileTokenProvider
impl !UnwindSafe for ProfileTokenProvider
impl Forget for ProfileTokenProvider
impl Freeze for ProfileTokenProvider
impl Send for ProfileTokenProvider
impl Sync for ProfileTokenProvider
impl Unpin for ProfileTokenProvider
impl UnsafeUnpin for ProfileTokenProvider
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