Struct ruma_events::call::member::LegacyMembershipData
source · pub struct LegacyMembershipData {
pub application: Application,
pub device_id: String,
pub expires: Duration,
pub created_ts: Option<MilliSecondsSinceUnixEpoch>,
pub foci_active: Vec<Focus>,
pub membership_id: String,
}
Expand description
A membership describes one of the sessions this user currently partakes.
The application defines the type of the session.
Fields§
§application: Application
The type of the MatrixRTC session the membership belongs to.
e.g. call, spacial, document…
device_id: String
The device id of this membership.
The same user can join with their phone/computer.
expires: Duration
The duration in milliseconds relative to the time this membership joined during which the membership is valid.
The time a member has joined is defined as:
MIN(content.created_ts, event.origin_server_ts)
created_ts: Option<MilliSecondsSinceUnixEpoch>
Stores a copy of the origin_server_ts
of the initial session event.
If the membership is updated this field will be used to track to
original origin_server_ts
.
foci_active: Vec<Focus>
A list of the foci in use for this membership.
membership_id: String
The id of the membership.
This is required to guarantee uniqueness of the event. Sending the same state event twice to synapse makes the HS drop the second one and return 200.
Implementations§
source§impl LegacyMembershipData
impl LegacyMembershipData
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.
Defaults to using created_ts
of the LegacyMembershipData
.
If no origin_server_ts
is provided and the event does not contain created_ts
the event will be considered as not expired.
In this case, a warning will be logged.
§Arguments
origin_server_ts
- a fallback ifLegacyMembershipData::created_ts
is not present
Trait Implementations§
source§impl Clone for LegacyMembershipData
impl Clone for LegacyMembershipData
source§fn clone(&self) -> LegacyMembershipData
fn clone(&self) -> LegacyMembershipData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LegacyMembershipData
impl Debug for LegacyMembershipData
source§impl<'de> Deserialize<'de> for LegacyMembershipData
impl<'de> Deserialize<'de> for LegacyMembershipData
source§fn 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>,
source§impl From<LegacyMembershipDataInit> for LegacyMembershipData
impl From<LegacyMembershipDataInit> for LegacyMembershipData
source§fn from(init: LegacyMembershipDataInit) -> Self
fn from(init: LegacyMembershipDataInit) -> Self
source§impl PartialEq for LegacyMembershipData
impl PartialEq for LegacyMembershipData
source§impl Serialize for LegacyMembershipData
impl Serialize for LegacyMembershipData
impl StructuralPartialEq for LegacyMembershipData
Auto Trait Implementations§
impl Freeze for LegacyMembershipData
impl RefUnwindSafe for LegacyMembershipData
impl Send for LegacyMembershipData
impl Sync for LegacyMembershipData
impl Unpin for LegacyMembershipData
impl UnwindSafe for LegacyMembershipData
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
)