pub struct TokenReply {
pub access_token: String,
pub token_type: String,
pub expires_in: u64,
pub refresh_token: String,
pub user: String,
}Expand description
A new pair of riff tokens. Send access_token with the DPoP
scheme and a proof from the device key. Use refresh_token once, to
get the next pair.
The reply to a swap for a session token has an empty
refresh_token: a session token has none
(01M52JYGWD3ZJKNYE3HG5BJYTP).
use riff_core::wire::TokenReply;
let json = r#"{"access_token":"a","token_type":"DPoP","expires_in":600,
"refresh_token":"","user":"mike"}"#;
let session: TokenReply = serde_json::from_str(json).unwrap();
assert!(session.refresh_token.is_empty());Fields§
§access_token: String§token_type: StringAlways DPoP.
expires_in: u64Seconds until the access token expires.
refresh_token: StringEmpty for a session token.
user: StringThe user part of the session URI, from the sign-in (R36).
Trait Implementations§
Source§impl Clone for TokenReply
impl Clone for TokenReply
Source§fn clone(&self) -> TokenReply
fn clone(&self) -> TokenReply
Returns a duplicate 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 TokenReply
impl Debug for TokenReply
Source§impl<'de> Deserialize<'de> for TokenReply
impl<'de> Deserialize<'de> for TokenReply
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for TokenReply
impl JsonSchema for TokenReply
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for TokenReply
impl PartialEq for TokenReply
Source§impl Serialize for TokenReply
impl Serialize for TokenReply
impl Eq for TokenReply
impl StructuralPartialEq for TokenReply
Auto Trait Implementations§
impl Freeze for TokenReply
impl RefUnwindSafe for TokenReply
impl Send for TokenReply
impl Sync for TokenReply
impl Unpin for TokenReply
impl UnsafeUnpin for TokenReply
impl UnwindSafe for TokenReply
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.