Struct ruma::events::call::member::LegacyMembershipData

source ·
pub struct LegacyMembershipData {
    pub application: Application,
    pub device_id: OwnedDeviceId,
    pub expires: Duration,
    pub created_ts: Option<MilliSecondsSinceUnixEpoch>,
    pub foci_active: Vec<Focus>,
    pub membership_id: String,
}
Available on crate features events and 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§

§application: Application

The type of the MatrixRTC session the membership belongs to.

e.g. call, spacial, document…

§device_id: OwnedDeviceId

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

source

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

Trait Implementations§

source§

impl Clone for LegacyMembershipData

source§

fn clone(&self) -> LegacyMembershipData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LegacyMembershipData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for LegacyMembershipData

source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<LegacyMembershipData, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<LegacyMembershipDataInit> for LegacyMembershipData

source§

fn from(init: LegacyMembershipDataInit) -> LegacyMembershipData

Converts to this type from the input type.
source§

impl PartialEq for LegacyMembershipData

source§

fn eq(&self, other: &LegacyMembershipData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for LegacyMembershipData

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for LegacyMembershipData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

source§

const WITNESS: W = W::MAKE

A constant of the type witness
source§

impl<T> Identity for T
where T: ?Sized,

source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T