pub struct HomeserverCapabilities { /* private fields */ }Expand description
Helper to check what Capabilities are supported by the homeserver.
Spec: https://spec.matrix.org/latest/client-server-api/#capabilities-negotiation
Implementations§
Source§impl HomeserverCapabilities
impl HomeserverCapabilities
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Creates a new HomeserverCapabilities instance.
Sourcepub async fn refresh(&self) -> Result<()>
pub async fn refresh(&self) -> Result<()>
Forces a refresh of the cached value using the /capabilities endpoint.
Sourcepub async fn can_change_password(&self) -> Result<bool>
pub async fn can_change_password(&self) -> Result<bool>
Returns whether the user can change their password or not.
Sourcepub async fn can_change_displayname(&self) -> Result<bool>
pub async fn can_change_displayname(&self) -> Result<bool>
Returns whether the user can change their display name or not.
This will first check the m.profile_fields capability and use it if
present, or fall back to m.set_displayname otherwise.
Spec: https://spec.matrix.org/latest/client-server-api/#mset_displayname-capability
Sourcepub async fn can_change_avatar(&self) -> Result<bool>
pub async fn can_change_avatar(&self) -> Result<bool>
Returns whether the user can change their avatar or not.
This will first check the m.profile_fields capability and use it if
present, or fall back to m.set_avatar_url otherwise.
Spec: https://spec.matrix.org/latest/client-server-api/#mset_avatar_url-capability
Sourcepub async fn can_change_thirdparty_ids(&self) -> Result<bool>
pub async fn can_change_thirdparty_ids(&self) -> Result<bool>
Returns whether the user can add, remove, or change 3PID associations on their account.
Spec: https://spec.matrix.org/latest/client-server-api/#m3pid_changes-capability
Sourcepub async fn can_get_login_token(&self) -> Result<bool>
pub async fn can_get_login_token(&self) -> Result<bool>
Returns whether the user is able to use POST /login/get_token to
generate single-use, time-limited tokens to log unauthenticated
clients into their account.
When not listed, clients SHOULD assume the user is unable to generate tokens.
Spec: https://spec.matrix.org/latest/client-server-api/#mget_login_token-capability
Sourcepub async fn extended_profile_fields(&self) -> Result<ProfileFieldsCapability>
pub async fn extended_profile_fields(&self) -> Result<ProfileFieldsCapability>
Returns which profile fields the user is able to change.
Spec: https://spec.matrix.org/latest/client-server-api/#mprofile_fields-capability
Sourcepub async fn room_versions(&self) -> Result<RoomVersionsCapability>
pub async fn room_versions(&self) -> Result<RoomVersionsCapability>
Returns the room versions supported by the server.
Spec: https://spec.matrix.org/latest/client-server-api/#mroom_versions-capability
Sourcepub async fn account_moderation(&self) -> Result<AccountModerationCapability>
pub async fn account_moderation(&self) -> Result<AccountModerationCapability>
Returns whether the user can perform account moderation actions.
Sourcepub async fn forgets_room_when_leaving(&self) -> Result<bool>
pub async fn forgets_room_when_leaving(&self) -> Result<bool>
Returns whether or not the server automatically forgets rooms which the user has left.
Spec: https://spec.matrix.org/latest/client-server-api/#mforget_forced_upon_leave-capability
Trait Implementations§
Source§impl Clone for HomeserverCapabilities
impl Clone for HomeserverCapabilities
Source§fn clone(&self) -> HomeserverCapabilities
fn clone(&self) -> HomeserverCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HomeserverCapabilities
impl !RefUnwindSafe for HomeserverCapabilities
impl Send for HomeserverCapabilities
impl Sync for HomeserverCapabilities
impl Unpin for HomeserverCapabilities
impl UnsafeUnpin for HomeserverCapabilities
impl !UnwindSafe for HomeserverCapabilities
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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