Struct mas_data_model::oauth2::DeviceCodeGrant
source · pub struct DeviceCodeGrant {
pub id: Ulid,
pub state: DeviceCodeGrantState,
pub client_id: Ulid,
pub scope: Scope,
pub user_code: String,
pub device_code: String,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub ip_address: Option<IpAddr>,
pub user_agent: Option<UserAgent>,
}
Fields§
§id: Ulid
§state: DeviceCodeGrantState
§client_id: Ulid
The client ID which requested this device code grant.
scope: Scope
The scope which was requested by this device code grant.
user_code: String
The user code which was generated for this device code grant. This is the one that the user will enter into their client.
device_code: String
The device code which was generated for this device code grant. This is the one that the client will use to poll for an access token.
created_at: DateTime<Utc>
The time at which this device code grant was created.
expires_at: DateTime<Utc>
The time at which this device code grant will expire.
ip_address: Option<IpAddr>
The IP address of the client which requested this device code grant.
user_agent: Option<UserAgent>
The user agent used to request this device code grant.
Implementations§
source§impl DeviceCodeGrant
impl DeviceCodeGrant
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>
Methods from Deref<Target = DeviceCodeGrantState>§
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 DeviceCodeGrant
impl Clone for DeviceCodeGrant
source§fn clone(&self) -> DeviceCodeGrant
fn clone(&self) -> DeviceCodeGrant
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeviceCodeGrant
impl Debug for DeviceCodeGrant
source§impl Deref for DeviceCodeGrant
impl Deref for DeviceCodeGrant
source§impl PartialEq for DeviceCodeGrant
impl PartialEq for DeviceCodeGrant
source§impl Serialize for DeviceCodeGrant
impl Serialize for DeviceCodeGrant
impl Eq for DeviceCodeGrant
impl StructuralPartialEq for DeviceCodeGrant
Auto Trait Implementations§
impl Freeze for DeviceCodeGrant
impl RefUnwindSafe for DeviceCodeGrant
impl Send for DeviceCodeGrant
impl Sync for DeviceCodeGrant
impl Unpin for DeviceCodeGrant
impl UnwindSafe for DeviceCodeGrant
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
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
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
key
and return true
if they are equal.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>
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>
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