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: &RumaSummary) -> bool
pub fn update_from_ruma_summary(&mut self, summary: &RumaSummary) -> 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) -> Option<&HistoryVisibility>
pub fn history_visibility(&self) -> Option<&HistoryVisibility>
Returns the history visibility for this room.
Returns None if the event was never seen during sync.
Sourcepub fn history_visibility_or_default(&self) -> &HistoryVisibility
pub fn history_visibility_or_default(&self) -> &HistoryVisibility
Returns the history visibility for this room, or a sensible default.
Returns Shared
, the default specified by the spec, when the event is
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>
pub fn latest_event(&self) -> Option<&LatestEvent>
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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