Struct matrix_sdk_base::ruma::api::client::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,
pub get_login_token: GetLoginTokenCapability,
/* private fields */
}
api
and (crate features 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: 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.
get_login_token: GetLoginTokenCapability
Capability to indicate if the user can generate tokens to log further clients into their account.
Implementations§
source§impl 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<'_> ⓘ
pub fn iter(&self) -> CapabilitiesIter<'_> ⓘ
Returns an iterator over the capabilities.
Trait Implementations§
source§impl Clone for Capabilities
impl Clone for Capabilities
source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Capabilities
impl Debug for Capabilities
source§impl Default for Capabilities
impl Default for Capabilities
source§fn default() -> Capabilities
fn default() -> Capabilities
source§impl<'de> Deserialize<'de> for Capabilities
impl<'de> Deserialize<'de> for Capabilities
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Capabilities, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Capabilities, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<Capabilities> for Response
impl From<Capabilities> for Response
source§fn from(capabilities: Capabilities) -> Response
fn from(capabilities: Capabilities) -> Response
source§impl<'a> IntoIterator for &'a Capabilities
impl<'a> IntoIterator for &'a Capabilities
§type Item = CapabilityRef<'a>
type Item = CapabilityRef<'a>
§type IntoIter = CapabilitiesIter<'a>
type IntoIter = CapabilitiesIter<'a>
source§fn into_iter(self) -> <&'a Capabilities as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a Capabilities as IntoIterator>::IntoIter
source§impl Serialize for Capabilities
impl Serialize for Capabilities
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,
Auto Trait Implementations§
impl Freeze for Capabilities
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnwindSafe for Capabilities
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more