Struct matrix_sdk_base::ruma::events::call::member::Membership
source · #[non_exhaustive]pub struct Membership {
pub application: Application,
pub device_id: String,
pub expires: Duration,
pub created_ts: Option<MilliSecondsSinceUnixEpoch>,
pub foci_active: Vec<Focus>,
pub membership_id: String,
}
unstable-msc3401
only.Expand description
A membership describes one of the sessions this user currently partakes.
The application defines the type of the session.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.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 Membership
impl Membership
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.
Defaults to using created_ts
of the Membership
.
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 ifcreated_ts
is not present
Trait Implementations§
source§impl Clone for Membership
impl Clone for Membership
source§fn clone(&self) -> Membership
fn clone(&self) -> Membership
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Membership
impl Debug for Membership
source§impl<'de> Deserialize<'de> for Membership
impl<'de> Deserialize<'de> for Membership
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Membership, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Membership, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<MembershipInit> for Membership
impl From<MembershipInit> for Membership
source§fn from(init: MembershipInit) -> Membership
fn from(init: MembershipInit) -> Membership
source§impl Serialize for Membership
impl Serialize for Membership
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Membership
impl RefUnwindSafe for Membership
impl Send for Membership
impl Sync for Membership
impl Unpin for Membership
impl UnwindSafe for Membership
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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