#[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§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