Struct matrix_sdk::RoomInfo
source · pub struct RoomInfo { /* private fields */ }
Expand description
The underlying pure data structure for joined and left rooms.
Holds all the info needed to persist a room into the state store.
Implementations§
source§impl RoomInfo
impl RoomInfo
sourcepub fn mark_as_joined(&mut self)
pub fn mark_as_joined(&mut self)
Mark this Room as joined.
sourcepub fn mark_as_left(&mut self)
pub fn mark_as_left(&mut self)
Mark this Room as left.
sourcepub fn mark_as_invited(&mut self)
pub fn mark_as_invited(&mut self)
Mark this Room as invited.
sourcepub fn mark_as_knocked(&mut self)
pub fn mark_as_knocked(&mut self)
Mark this Room as knocked.
sourcepub fn mark_members_synced(&mut self)
pub fn mark_members_synced(&mut self)
Mark this Room as having all the members synced.
sourcepub fn mark_members_missing(&mut self)
pub fn mark_members_missing(&mut self)
Mark this Room as still missing member information.
sourcepub fn mark_state_partially_synced(&mut self)
pub fn mark_state_partially_synced(&mut self)
Mark this Room as still missing some state information.
sourcepub fn mark_state_fully_synced(&mut self)
pub fn mark_state_fully_synced(&mut self)
Mark this Room as still having all state synced.
sourcepub fn mark_state_not_synced(&mut self)
pub fn mark_state_not_synced(&mut self)
Mark this Room as still having no state synced.
sourcepub fn mark_encryption_state_synced(&mut self)
pub fn mark_encryption_state_synced(&mut self)
Mark this Room as having the encryption state synced.
sourcepub fn mark_encryption_state_missing(&mut self)
pub fn mark_encryption_state_missing(&mut self)
Mark this Room as still missing encryption state information.
sourcepub fn set_prev_batch(&mut self, prev_batch: Option<&str>) -> bool
pub fn set_prev_batch(&mut self, prev_batch: Option<&str>) -> bool
Set the prev_batch
-token.
Returns whether the token has differed and thus has been upgraded:
false
means no update was applied as the were the same
sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Returns whether this is an encrypted room.
sourcepub fn set_encryption_event(
&mut self,
event: Option<RoomEncryptionEventContent>,
)
pub fn set_encryption_event( &mut self, event: Option<RoomEncryptionEventContent>, )
Set the encryption event content in this room.
sourcepub fn handle_state_event(&mut self, event: &AnySyncStateEvent) -> bool
pub fn handle_state_event(&mut self, event: &AnySyncStateEvent) -> bool
Handle the given state event.
Returns true if the event modified the info, false otherwise.
sourcepub fn handle_stripped_state_event(
&mut self,
event: &AnyStrippedStateEvent,
) -> bool
pub fn handle_stripped_state_event( &mut self, event: &AnyStrippedStateEvent, ) -> bool
Handle the given stripped state event.
Returns true if the event modified the info, false otherwise.
sourcepub fn handle_redaction(
&mut self,
event: &SyncRoomRedactionEvent,
_raw: &Raw<SyncRoomRedactionEvent>,
)
pub fn handle_redaction( &mut self, event: &SyncRoomRedactionEvent, _raw: &Raw<SyncRoomRedactionEvent>, )
Handle the given redaction.
sourcepub fn avatar_url(&self) -> Option<&MxcUri>
pub fn avatar_url(&self) -> Option<&MxcUri>
Returns the current room avatar.
sourcepub fn update_avatar(&mut self, url: Option<OwnedMxcUri>)
pub fn update_avatar(&mut self, url: Option<OwnedMxcUri>)
Update the room avatar.
sourcepub fn avatar_info(&self) -> Option<&ImageInfo>
pub fn avatar_info(&self) -> Option<&ImageInfo>
Returns information about the current room avatar.
sourcepub fn update_notification_count(
&mut self,
notification_counts: UnreadNotificationsCount,
)
pub fn update_notification_count( &mut self, notification_counts: UnreadNotificationsCount, )
Update the notifications count.
sourcepub fn update_from_ruma_summary(&mut self, summary: &RoomSummary) -> bool
pub fn update_from_ruma_summary(&mut self, summary: &RoomSummary) -> bool
Update the RoomSummary from a Ruma RoomSummary
.
Returns true if any field has been updated, false otherwise.
sourcepub fn active_members_count(&self) -> u64
pub fn active_members_count(&self) -> u64
The number of active members (invited + joined) in the room.
The return value is saturated at u64::MAX
.
sourcepub fn invited_members_count(&self) -> u64
pub fn invited_members_count(&self) -> u64
The number of invited members in the room
sourcepub fn joined_members_count(&self) -> u64
pub fn joined_members_count(&self) -> u64
The number of joined members in the room
sourcepub fn canonical_alias(&self) -> Option<&RoomAliasId>
pub fn canonical_alias(&self) -> Option<&RoomAliasId>
Get the canonical alias of this room.
sourcepub fn alt_aliases(&self) -> &[OwnedRoomAliasId]
pub fn alt_aliases(&self) -> &[OwnedRoomAliasId]
Get the alternative aliases of this room.
sourcepub fn room_version(&self) -> Option<&RoomVersionId>
pub fn room_version(&self) -> Option<&RoomVersionId>
Get the room version of this room.
sourcepub fn room_version_or_default(&self) -> RoomVersionId
pub fn room_version_or_default(&self) -> RoomVersionId
Get the room version of this room, or a sensible default.
Will warn (at most once) if the room creation event is missing from this
RoomInfo
.
sourcepub fn history_visibility(&self) -> &HistoryVisibility
pub fn history_visibility(&self) -> &HistoryVisibility
Returns the history visibility for this room.
Defaults to WorldReadable
, if missing.
sourcepub fn join_rule(&self) -> &JoinRule
pub fn join_rule(&self) -> &JoinRule
Returns the join rule for this room.
Defaults to Public
, if missing.
sourcepub fn has_active_room_call(&self) -> bool
pub fn has_active_room_call(&self) -> bool
Is there a non expired membership with application “m.call” and scope “m.room” in this room.
sourcepub fn active_room_call_participants(&self) -> Vec<OwnedUserId>
pub fn active_room_call_participants(&self) -> Vec<OwnedUserId>
Returns a Vec of userId’s that participate in the room call.
matrix_rtc memberships with application “m.call” and scope “m.room” are considered. A user can occur twice if they join with two devices. convert to a set depending if the different users are required or the amount of sessions.
The vector is ordered by oldest membership user to newest.
sourcepub fn latest_event(&self) -> Option<&LatestEvent>
Available on crate feature experimental-sliding-sync
only.
pub fn latest_event(&self) -> Option<&LatestEvent>
experimental-sliding-sync
only.Returns the latest (decrypted) event recorded for this room.
sourcepub fn pinned_event_ids(&self) -> Option<Vec<OwnedEventId>>
pub fn pinned_event_ids(&self) -> Option<Vec<OwnedEventId>>
Returns the current pinned event ids for this room.
sourcepub fn is_pinned_event(&self, event_id: &EventId) -> bool
pub fn is_pinned_event(&self, event_id: &EventId) -> bool
Checks if an EventId
is currently pinned.
It avoids having to clone the whole list of event ids to check a single
value.
Returns true
if the provided event_id
is pinned, false
otherwise.
Trait Implementations§
source§impl<'de> Deserialize<'de> for RoomInfo
impl<'de> Deserialize<'de> for RoomInfo
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RoomInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RoomInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Serialize for RoomInfo
impl Serialize for RoomInfo
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 RoomInfo
impl RefUnwindSafe for RoomInfo
impl Send for RoomInfo
impl Sync for RoomInfo
impl Unpin for RoomInfo
impl UnwindSafe for RoomInfo
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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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