pub enum MembershipData<'a> {
Legacy(&'a LegacyMembershipData),
Session(&'a SessionMembershipData),
}
events
and unstable-msc3401
only.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§
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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