Struct ruma::api::client::discovery::get_capabilities::Capabilities
source · [−]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,
/* private fields */
}
client-api-c
or client-api-s
) and (crate features client
or server
) and crate feature api
only.Expand description
Contains information about all the capabilities that the server supports.
Fields
change_password: ChangePasswordCapability
Capability to indicate if the user can change their password.
room_versions: RoomVersionsCapability
The room versions the server supports.
set_displayname: SetDisplayNameCapability
Capability to indicate if the user can change their display name.
set_avatar_url: SetAvatarUrlCapability
Capability to indicate if the user can change their avatar.
thirdparty_id_changes: ThirdPartyIdChangesCapability
Capability to indicate if the user can change the third-party identifiers associated with their account.
Implementations
sourceimpl Capabilities
impl Capabilities
sourcepub fn new() -> Capabilities
pub fn new() -> Capabilities
Creates empty Capabilities
.
sourcepub fn get(&self, capability: &str) -> Option<Cow<'_, Value>>
pub fn get(&self, capability: &str) -> Option<Cow<'_, Value>>
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: Value) -> Result<(), Error>
pub fn set(&mut self, capability: &str, value: Value) -> Result<(), Error>
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.
sourcepub fn iter(&self) -> CapabilitiesIter<'_>ⓘNotable traits for CapabilitiesIter<'a>impl<'a> Iterator for CapabilitiesIter<'a> type Item = CapabilityRef<'a>;
pub fn iter(&self) -> CapabilitiesIter<'_>ⓘNotable traits for CapabilitiesIter<'a>impl<'a> Iterator for CapabilitiesIter<'a> type Item = CapabilityRef<'a>;
Returns an iterator over the capabilities.
Trait Implementations
sourceimpl Clone for Capabilities
impl Clone for Capabilities
sourcefn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more