Enum ruma_events::call::member::MembershipData
source · #[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<'a> MembershipData<'a>
impl<'a> MembershipData<'a>
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 moreAuto Trait Implementations§
impl<'a> Freeze for MembershipData<'a>
impl<'a> RefUnwindSafe for MembershipData<'a>
impl<'a> Send for MembershipData<'a>
impl<'a> Sync for MembershipData<'a>
impl<'a> Unpin for MembershipData<'a>
impl<'a> UnwindSafe for MembershipData<'a>
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
)