Struct ruma_client_api::discovery::get_capabilities::Capabilities
source · [−]#[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,
/* private fields */
}
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: 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 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.
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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Capabilities
impl Debug for Capabilities
sourceimpl Default for Capabilities
impl Default for Capabilities
sourcefn default() -> Capabilities
fn default() -> Capabilities
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Capabilities
impl<'de> Deserialize<'de> for Capabilities
sourcefn 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
sourceimpl From<Capabilities> for Response
impl From<Capabilities> for Response
sourcefn from(capabilities: Capabilities) -> Self
fn from(capabilities: Capabilities) -> Self
Converts to this type from the input type.
sourceimpl<'a> IntoIterator for &'a Capabilities
impl<'a> IntoIterator for &'a Capabilities
type Item = CapabilityRef<'a>
type Item = CapabilityRef<'a>
The type of the elements being iterated over.
type IntoIter = CapabilitiesIter<'a>
type IntoIter = CapabilitiesIter<'a>
Which kind of iterator are we turning this into?
sourceimpl Serialize for Capabilities
impl Serialize for Capabilities
Auto Trait Implementations
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnwindSafe for Capabilities
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more