#[non_exhaustive]pub enum MembershipData<'a> {
Legacy(&'a LegacyMembershipData),
Session(&'a SessionMembershipData),
}
Expand description
The data object that contains the information for one membership.
It can be a legacy or a normal MatrixRTC Session membership.
The legacy format contains time information to compute if it is expired or not. SessionMembershipData does not have the concept of timestamp based expiration anymore. The state event will reliably be set to empty when the user disconnects.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Legacy(&'a LegacyMembershipData)
The legacy format (using an array of memberships for each device -> one event per user)
Session(&'a SessionMembershipData)
One event per device. SessionMembershipData
contains all the information required to
represent the current membership state of one device.
Implementations§
Source§impl MembershipData<'_>
impl MembershipData<'_>
Sourcepub fn application(&self) -> &Application
pub fn application(&self) -> &Application
The application this RTC membership participates in (the session type, can be m.call
…)
Sourcepub fn focus_active(&self) -> &ActiveFocus
pub fn focus_active(&self) -> &ActiveFocus
The active focus is a FocusType specific object that describes how this user is currently connected.
It can use the foci_preferred list to choose one of the available (preferred) foci or specific information on how to connect to this user.
Every user needs to converge to use the same focus_active type.
Sourcepub fn foci_preferred(&self) -> &Vec<Focus>
pub fn foci_preferred(&self) -> &Vec<Focus>
The list of available/preferred options this user provides to connect to the call.
Sourcepub fn is_room_call(&self) -> bool
pub fn is_room_call(&self) -> bool
The application of the membership is “m.call” and the scope is “m.room”.
Sourcepub fn is_expired(
&self,
origin_server_ts: Option<MilliSecondsSinceUnixEpoch>,
) -> bool
pub fn is_expired( &self, origin_server_ts: Option<MilliSecondsSinceUnixEpoch>, ) -> bool
Checks if the event is expired. This is only relevant for LegacyMembershipData
returns false
if its SessionMembershipData
Sourcepub fn created_ts(&self) -> Option<MilliSecondsSinceUnixEpoch>
pub fn created_ts(&self) -> Option<MilliSecondsSinceUnixEpoch>
Gets the created_ts of the event.
This is the origin_server_ts
for session data.
For legacy events this can either be the origin server ts or a copy from the
origin_server_ts
since we expect legacy events to get updated (when a new device
joins/leaves).
Trait Implementations§
Source§impl<'a> Clone for MembershipData<'a>
impl<'a> Clone for MembershipData<'a>
Source§fn clone(&self) -> MembershipData<'a>
fn clone(&self) -> MembershipData<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more