pub enum DeviceCodeGrantState {
Pending,
Fulfilled {
browser_session_id: Ulid,
fulfilled_at: DateTime<Utc>,
},
Rejected {
browser_session_id: Ulid,
rejected_at: DateTime<Utc>,
},
Exchanged {
browser_session_id: Ulid,
fulfilled_at: DateTime<Utc>,
exchanged_at: DateTime<Utc>,
session_id: Ulid,
},
}
Variants§
Pending
The device code grant is pending.
Fulfilled
The device code grant has been fulfilled by a user.
Fields
Rejected
The device code grant has been rejected by a user.
Fields
Exchanged
The device code grant was exchanged for an access token.
Fields
Implementations§
source§impl DeviceCodeGrantState
impl DeviceCodeGrantState
sourcepub fn fulfill(
self,
browser_session: &BrowserSession,
fulfilled_at: DateTime<Utc>,
) -> Result<Self, InvalidTransitionError>
pub fn fulfill( self, browser_session: &BrowserSession, fulfilled_at: DateTime<Utc>, ) -> Result<Self, InvalidTransitionError>
sourcepub fn reject(
self,
browser_session: &BrowserSession,
rejected_at: DateTime<Utc>,
) -> Result<Self, InvalidTransitionError>
pub fn reject( self, browser_session: &BrowserSession, rejected_at: DateTime<Utc>, ) -> Result<Self, InvalidTransitionError>
sourcepub fn exchange(
self,
session: &Session,
exchanged_at: DateTime<Utc>,
) -> Result<Self, InvalidTransitionError>
pub fn exchange( self, session: &Session, exchanged_at: DateTime<Utc>, ) -> Result<Self, InvalidTransitionError>
sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true
if the device code grant state is Pending
.
sourcepub fn is_fulfilled(&self) -> bool
pub fn is_fulfilled(&self) -> bool
Returns true
if the device code grant state is Fulfilled
.
sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Returns true
if the device code grant state is Rejected
.
sourcepub fn is_exchanged(&self) -> bool
pub fn is_exchanged(&self) -> bool
Returns true
if the device code grant state is Exchanged
.
Trait Implementations§
source§impl Clone for DeviceCodeGrantState
impl Clone for DeviceCodeGrantState
source§fn clone(&self) -> DeviceCodeGrantState
fn clone(&self) -> DeviceCodeGrantState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DeviceCodeGrantState
impl Debug for DeviceCodeGrantState
source§impl PartialEq for DeviceCodeGrantState
impl PartialEq for DeviceCodeGrantState
source§fn eq(&self, other: &DeviceCodeGrantState) -> bool
fn eq(&self, other: &DeviceCodeGrantState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DeviceCodeGrantState
impl Serialize for DeviceCodeGrantState
impl Eq for DeviceCodeGrantState
impl StructuralPartialEq for DeviceCodeGrantState
Auto Trait Implementations§
impl Freeze for DeviceCodeGrantState
impl RefUnwindSafe for DeviceCodeGrantState
impl Send for DeviceCodeGrantState
impl Sync for DeviceCodeGrantState
impl Unpin for DeviceCodeGrantState
impl UnwindSafe for DeviceCodeGrantState
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.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.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