#[non_exhaustive]pub struct DeviceAuthorization {
pub device_authorization_url: String,
pub token_url: String,
pub refresh_url: Option<String>,
pub scopes: Scopes,
pub extensions: PropMap<String, Value>,
}Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.Device authorization url for this flow. OAuth2 standard requires TLS.
token_url: StringToken url for this flow. OAuth2 standard requires TLS.
refresh_url: Option<String>Optional refresh token url.
scopes: ScopesScopes required by the flow.
extensions: PropMap<String, Value>Optional extensions “x-something”
Implementations§
Source§impl DeviceAuthorization
impl DeviceAuthorization
Sourcepub fn new<S: Into<String>>(
device_authorization_url: S,
token_url: S,
scopes: Scopes,
) -> Self
pub fn new<S: Into<String>>( device_authorization_url: S, token_url: S, scopes: Scopes, ) -> Self
Construct a new device authorization OAuth flow.
§Examples
DeviceAuthorization::new(
"https://localhost/device_authorization",
"https://localhost/token",
Scopes::from_iter([("edit:items", "edit my items")]),
);Sourcepub fn with_refresh_url<S: Into<String>>(
device_authorization_url: S,
token_url: S,
scopes: Scopes,
refresh_url: S,
) -> Self
pub fn with_refresh_url<S: Into<String>>( device_authorization_url: S, token_url: S, scopes: Scopes, refresh_url: S, ) -> Self
Construct a new device authorization OAuth flow with an additional refresh URL.
§Examples
DeviceAuthorization::with_refresh_url(
"https://localhost/device_authorization",
"https://localhost/token",
Scopes::new(),
"https://localhost/refresh-token",
);Sourcepub fn extensions(self, extensions: PropMap<String, Value>) -> Self
pub fn extensions(self, extensions: PropMap<String, Value>) -> Self
Add openapi extensions (x-something) for DeviceAuthorization.
Trait Implementations§
Source§impl Clone for DeviceAuthorization
impl Clone for DeviceAuthorization
Source§fn clone(&self) -> DeviceAuthorization
fn clone(&self) -> DeviceAuthorization
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 moreSource§impl Debug for DeviceAuthorization
impl Debug for DeviceAuthorization
Source§impl<'de> Deserialize<'de> for DeviceAuthorization
impl<'de> Deserialize<'de> for DeviceAuthorization
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
impl Eq for DeviceAuthorization
Source§impl PartialEq for DeviceAuthorization
impl PartialEq for DeviceAuthorization
Source§impl Serialize for DeviceAuthorization
impl Serialize for DeviceAuthorization
impl StructuralPartialEq for DeviceAuthorization
Auto Trait Implementations§
impl Freeze for DeviceAuthorization
impl RefUnwindSafe for DeviceAuthorization
impl Send for DeviceAuthorization
impl Sync for DeviceAuthorization
impl Unpin for DeviceAuthorization
impl UnsafeUnpin for DeviceAuthorization
impl UnwindSafe for DeviceAuthorization
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.