pub struct GmailSession { /* private fields */ }Expand description
A live Gmail OAuth2 session: holds the refresh token and the current in-memory access token, refreshing on demand.
Uses tokio::sync::Mutex (not std::sync::Mutex) held across the
refresh network call — unlike
SnowflakeSession::renew,
which releases its lock before the network call and accepts concurrent
refreshes racing each other. Gmail’s design requires single-flight
refresh (issue #1465’s explicit “concurrent callers don’t stampede”
requirement): a second concurrent caller blocks on this mutex and, once
unblocked, observes the already-refreshed token instead of issuing a
second POST.
Auto Trait Implementations§
impl !Freeze for GmailSession
impl !RefUnwindSafe for GmailSession
impl !UnwindSafe for GmailSession
impl Send for GmailSession
impl Sync for GmailSession
impl Unpin for GmailSession
impl UnsafeUnpin for GmailSession
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