Enum matrix_sdk::oidc::types::scope::ScopeToken
pub enum ScopeToken {
Openid,
Profile,
Email,
Address,
Phone,
OfflineAccess,
MatrixApi(MatrixApiScopeToken),
MatrixDevice(PrivString),
Custom(PrivString),
}
experimental-oidc
only.Expand description
Tokens to define the scope of an access token or to request specific claims.
Variants§
Openid
openid
Required for OpenID Connect requests.
Profile
profile
Requests access to the end-user’s profile.
email
Requests access to the end-user’s email address.
Address
address
Requests access to the end-user’s address.
Phone
phone
Requests access to the end-user’s phone number.
OfflineAccess
offline_access
Requests that an OAuth 2.0 refresh token be issued that can be used to obtain an access token that grants access to the end-user’s UserInfo Endpoint even when the end-user is not present (not logged in).
MatrixApi(MatrixApiScopeToken)
urn:matrix:org.matrix.msc2967.client:api:{token}
Requests access to the Matrix Client-Server API.
MatrixDevice(PrivString)
urn:matrix:org.matrix.msc2967.client:device:{device_id}
Requests access to the Matrix device with the given device_id
.
To access the device ID, use ScopeToken::matrix_device_id
.
Custom(PrivString)
Another scope token.
To access it’s value use this type’s Display
implementation.
Implementations§
§impl ScopeToken
impl ScopeToken
pub fn try_with_matrix_device(
device_id: String
) -> Result<ScopeToken, InvalidScope>
pub fn try_with_matrix_device( device_id: String ) -> Result<ScopeToken, InvalidScope>
Creates a Matrix device scope token with the given device ID.
§Errors
Returns an error if the device ID string is not compatible with the scope syntax.
pub fn matrix_device_id(&self) -> Option<&str>
pub fn matrix_device_id(&self) -> Option<&str>
Get the device ID of this scope token, if it is a
ScopeToken::MatrixDevice
.
Trait Implementations§
§impl Clone for ScopeToken
impl Clone for ScopeToken
§fn clone(&self) -> ScopeToken
fn clone(&self) -> ScopeToken
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ScopeToken
impl Debug for ScopeToken
§impl Display for ScopeToken
impl Display for ScopeToken
§impl From<ScopeToken> for ScopeToken
impl From<ScopeToken> for ScopeToken
§fn from(t: ScopeToken) -> ScopeToken
fn from(t: ScopeToken) -> ScopeToken
§impl From<ScopeToken> for ScopeToken
impl From<ScopeToken> for ScopeToken
§fn from(t: ScopeToken) -> ScopeToken
fn from(t: ScopeToken) -> ScopeToken
§impl FromIterator<ScopeToken> for Scope
impl FromIterator<ScopeToken> for Scope
§fn from_iter<T>(iter: T) -> Scopewhere
T: IntoIterator<Item = ScopeToken>,
fn from_iter<T>(iter: T) -> Scopewhere
T: IntoIterator<Item = ScopeToken>,
§impl FromStr for ScopeToken
impl FromStr for ScopeToken
§type Err = InvalidScope
type Err = InvalidScope
§fn from_str(s: &str) -> Result<ScopeToken, <ScopeToken as FromStr>::Err>
fn from_str(s: &str) -> Result<ScopeToken, <ScopeToken as FromStr>::Err>
s
to return a value of this type. Read more§impl Hash for ScopeToken
impl Hash for ScopeToken
§impl Ord for ScopeToken
impl Ord for ScopeToken
§impl PartialEq for ScopeToken
impl PartialEq for ScopeToken
§fn eq(&self, other: &ScopeToken) -> bool
fn eq(&self, other: &ScopeToken) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for ScopeToken
impl PartialOrd for ScopeToken
§fn partial_cmp(&self, other: &ScopeToken) -> Option<Ordering>
fn partial_cmp(&self, other: &ScopeToken) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for ScopeToken
impl StructuralPartialEq for ScopeToken
Auto Trait Implementations§
impl RefUnwindSafe for ScopeToken
impl Send for ScopeToken
impl Sync for ScopeToken
impl Unpin for ScopeToken
impl UnwindSafe for ScopeToken
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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
§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
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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>