pub struct TokenRefreshWorker { /* private fields */ }Expand description
Background worker that polls the TokenRefreshScheduler and refreshes
expiring OAuth tokens.
Implementations§
Source§impl TokenRefreshWorker
impl TokenRefreshWorker
Sourcepub fn new(
scheduler: Arc<TokenRefreshScheduler>,
refresher: Arc<dyn TokenRefresher>,
poll_interval: StdDuration,
) -> (Self, Sender<bool>)
pub fn new( scheduler: Arc<TokenRefreshScheduler>, refresher: Arc<dyn TokenRefresher>, poll_interval: StdDuration, ) -> (Self, Sender<bool>)
Create a new token refresh worker.
Returns the worker and a sender to trigger cancellation (send true to
stop).
Auto Trait Implementations§
impl Freeze for TokenRefreshWorker
impl !RefUnwindSafe for TokenRefreshWorker
impl Send for TokenRefreshWorker
impl Sync for TokenRefreshWorker
impl Unpin for TokenRefreshWorker
impl UnsafeUnpin for TokenRefreshWorker
impl !UnwindSafe for TokenRefreshWorker
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> 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