#[non_exhaustive]pub struct AdminCapability {
pub allowed_scopes: BTreeSet<OAuthClientScope>,
}Available on crate feature
api and crate feature unstable-msc4540 and (crate features client-api-c or client-api-s) 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>) -> AdminCapability
pub fn new(allowed_scopes: BTreeSet<OAuthClientScope>) -> AdminCapability
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§fn clone(&self) -> AdminCapability
fn clone(&self) -> AdminCapability
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 AdminCapability
impl Debug for AdminCapability
Source§impl Default for AdminCapability
impl Default for AdminCapability
Source§fn default() -> AdminCapability
fn default() -> AdminCapability
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AdminCapability
impl<'de> Deserialize<'de> for AdminCapability
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AdminCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AdminCapability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AdminCapability
impl Serialize for AdminCapability
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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