Struct matrix_sdk_base::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
sourceimpl 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_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 still missing member 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
Whether this is an encrypted 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: &OriginalSyncRoomRedactionEvent)
pub fn handle_redaction(&mut self, event: &OriginalSyncRoomRedactionEvent)
Handle the given redaction.
Returns true if the event modified the info, false otherwise.
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_summary(&mut self, summary: &RumaSummary) -> bool
pub fn update_summary(&mut self, summary: &RumaSummary) -> bool
Update the RoomSummary
Returns true if the Summary modified the info, 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 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_type(&self) -> Option<&CreateRoomType>
pub fn room_type(&self) -> Option<&CreateRoomType>
Get the room type of this room.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for RoomInfo
impl<'de> Deserialize<'de> for RoomInfo
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
Auto Trait Implementations
impl RefUnwindSafe for RoomInfo
impl Send for RoomInfo
impl Sync for RoomInfo
impl Unpin for RoomInfo
impl UnwindSafe for RoomInfo
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