#[non_exhaustive]pub struct Capabilities {
pub change_password: ChangePasswordCapability,
pub room_versions: RoomVersionsCapability,
pub set_displayname: SetDisplayNameCapability,
pub set_avatar_url: SetAvatarUrlCapability,
pub thirdparty_id_changes: ThirdPartyIdChangesCapability,
pub get_login_token: GetLoginTokenCapability,
pub profile_fields: Option<ProfileFieldsCapability>,
pub forget_forced_upon_leave: ForgetForcedUponLeaveCapability,
pub account_moderation: AccountModerationCapability,
pub admin: AdminCapability,
/* private fields */
}client or server only.Expand description
Contains information about all the capabilities that the server supports.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.change_password: ChangePasswordCapabilityCapability to indicate if the user can change their password.
room_versions: RoomVersionsCapabilityThe room versions the server supports.
set_displayname: SetDisplayNameCapabilitySince Matrix 1.16, prefer profile_fields if it is set.
Capability to indicate if the user can change their display name.
set_avatar_url: SetAvatarUrlCapabilitySince Matrix 1.16, prefer profile_fields if it is set.
Capability to indicate if the user can change their avatar.
thirdparty_id_changes: ThirdPartyIdChangesCapabilityCapability to indicate if the user can change the third-party identifiers associated with their account.
get_login_token: GetLoginTokenCapabilityCapability to indicate if the user can generate tokens to log further clients into their account.
profile_fields: Option<ProfileFieldsCapability>Capability to indicate if the user can set extended profile fields.
forget_forced_upon_leave: ForgetForcedUponLeaveCapabilityCapability to indicate if the server automatically forgets rooms that the user leaves.
account_moderation: AccountModerationCapabilityCapability to indicate if the user can perform account moderation actions via server administration endpoints.
admin: AdminCapabilityunstable-msc4540 only.Capability to indicate if the user can perform administrative actions. (MSC4540)
Implementations§
Source§impl Capabilities
impl Capabilities
Sourcepub fn get(&self, capability: &str) -> Option<Cow<'_, JsonValue>>
pub fn get(&self, capability: &str) -> Option<Cow<'_, JsonValue>>
Returns the value of the given capability.
Prefer to use the public fields of Capabilities where possible; this method is meant
to be used for unsupported capabilities only.
Sourcepub fn set(&mut self, capability: &str, value: JsonValue) -> Result<()>
pub fn set(&mut self, capability: &str, value: JsonValue) -> Result<()>
Sets a capability to the given value.
Prefer to use the public fields of Capabilities where possible; this method is meant
to be used for unsupported capabilities only and does not allow setting
arbitrary data for supported ones.