#[non_exhaustive]pub struct AdminCapability {
pub allowed_scopes: BTreeSet<OAuthClientScope>,
}Available on crate feature
unstable-msc4540 and (crate features client or server) only.Expand description
Information about the m.admin capability. (MSC4540)
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.allowed_scopes: BTreeSet<OAuthClientScope>The scopes the device may request to access administrative functionality.
Implementations§
Source§impl AdminCapability
impl AdminCapability
Sourcepub fn new(allowed_scopes: BTreeSet<OAuthClientScope>) -> Self
pub fn new(allowed_scopes: BTreeSet<OAuthClientScope>) -> Self
Create a new AdminCapability.
Sourcepub fn is_admin(&self) -> bool
pub fn is_admin(&self) -> bool
Returns whether the capability indicates that the authenticated user is able to access some administrative functionality.
Sourcepub fn is_scope_allowed(&self, scope: &OAuthClientScope) -> bool
pub fn is_scope_allowed(&self, scope: &OAuthClientScope) -> bool
Returns whether the admin functionality gated by a particular scope is available to the authenticated user.
Trait Implementations§
Source§impl Clone for AdminCapability
impl Clone for AdminCapability
Source§impl Debug for AdminCapability
impl Debug for AdminCapability
Source§impl Default for AdminCapability
impl Default for AdminCapability
Source§impl<'de> Deserialize<'de> for AdminCapability
impl<'de> Deserialize<'de> for AdminCapability
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
Auto Trait Implementations§
impl Freeze for AdminCapability
impl RefUnwindSafe for AdminCapability
impl Send for AdminCapability
impl Sync for AdminCapability
impl Unpin for AdminCapability
impl UnsafeUnpin for AdminCapability
impl UnwindSafe for AdminCapability
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