pub enum GmailScope {
ReadOnly,
Modify,
}Expand description
The Gmail OAuth2 scope granted at login.
Variants§
ReadOnly
List/read messages, threads, labels, and history. Default; never requests send.
Modify
Everything ReadOnly grants, plus label add/remove
(batchModify).
Implementations§
Source§impl GmailScope
impl GmailScope
Sourcepub fn from_granted(granted: &str) -> Option<Self>
pub fn from_granted(granted: &str) -> Option<Self>
Parses Google’s space-separated granted-scope response, treating the
presence of the modify scope anywhere in it as Modify
and the readonly scope (with no modify) as ReadOnly.
Returns None when neither Gmail scope is present — e.g. the user
left the Gmail permission unticked on Google’s consent screen — so
callers can reject the grant instead of silently defaulting to
ReadOnly.
Sourcepub fn allows_modify(self) -> bool
pub fn allows_modify(self) -> bool
Whether this scope allows label-mutating calls (batchModify).
Trait Implementations§
Source§impl Clone for GmailScope
impl Clone for GmailScope
Source§fn clone(&self) -> GmailScope
fn clone(&self) -> GmailScope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GmailScope
Source§impl Debug for GmailScope
impl Debug for GmailScope
Source§impl Default for GmailScope
impl Default for GmailScope
Source§fn default() -> GmailScope
fn default() -> GmailScope
Returns the “default value” for a type. Read more
impl Eq for GmailScope
Source§impl PartialEq for GmailScope
impl PartialEq for GmailScope
impl StructuralPartialEq for GmailScope
Auto Trait Implementations§
impl Freeze for GmailScope
impl RefUnwindSafe for GmailScope
impl Send for GmailScope
impl Sync for GmailScope
impl Unpin for GmailScope
impl UnsafeUnpin for GmailScope
impl UnwindSafe for GmailScope
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.