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