Enum CallMemberEventContent
#[non_exhaustive]pub enum CallMemberEventContent {
LegacyContent(LegacyMembershipContent),
SessionContent(SessionMembershipData),
Empty(EmptyMembershipData),
}Expand description
The member state event for a MatrixRTC session.
This is the object containing all the data related to a Matrix users participation in a MatrixRTC session.
This is a unit struct with the enum CallMemberEventContent because a Ruma state event cannot
be an enum and we need this to be an untagged enum for parsing purposes. (see
CallMemberEventContent)
This struct also exposes allows to call the methods from CallMemberEventContent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LegacyContent(LegacyMembershipContent)
The legacy format for m.call.member events. (An array of memberships. The devices of one user.)
SessionContent(SessionMembershipData)
Normal membership events. One event per membership. Multiple state keys will be used to describe multiple devices for one user.
Empty(EmptyMembershipData)
An empty content means this user has been in a rtc session but is not anymore.
Implementations§
§impl CallMemberEventContent
impl CallMemberEventContent
pub fn new_legacy(
memberships: Vec<LegacyMembershipData>,
) -> CallMemberEventContent
pub fn new_legacy( memberships: Vec<LegacyMembershipData>, ) -> CallMemberEventContent
Creates a new CallMemberEventContent with LegacyMembershipData.
pub fn new(
application: Application,
device_id: OwnedDeviceId,
focus_active: ActiveFocus,
foci_preferred: Vec<Focus>,
created_ts: Option<MilliSecondsSinceUnixEpoch>,
expires: Option<Duration>,
) -> CallMemberEventContent
pub fn new( application: Application, device_id: OwnedDeviceId, focus_active: ActiveFocus, foci_preferred: Vec<Focus>, created_ts: Option<MilliSecondsSinceUnixEpoch>, expires: Option<Duration>, ) -> CallMemberEventContent
Creates a new CallMemberEventContent with SessionMembershipData.
§Arguments
application- The application that is creating the membership.device_id- The device ID of the member.focus_active- The active focus state of the member.foci_preferred- The preferred focus states of the member.created_ts- The timestamp when this state event chain for memberships was created. when updating the event thecreated_tsshould be copied from the previous state. Set toNoneif this is the initial join event for the session.expires- The time after which the event is considered as expired. Defaults to 4 hours.
pub fn new_empty(leave_reason: Option<LeaveReason>) -> CallMemberEventContent
pub fn new_empty(leave_reason: Option<LeaveReason>) -> CallMemberEventContent
Creates a new Empty CallMemberEventContent representing a left membership.
pub fn active_memberships(
&self,
origin_server_ts: Option<MilliSecondsSinceUnixEpoch>,
) -> Vec<MembershipData<'_>>
pub fn active_memberships( &self, origin_server_ts: Option<MilliSecondsSinceUnixEpoch>, ) -> Vec<MembershipData<'_>>
All non expired memberships in this member event.
In most cases you want to use this method instead of the public memberships field. The memberships field will also include expired events.
This copies all the memberships and converts them
§Arguments
origin_server_ts- optionally theorigin_server_tscan be passed as a fallback in the Membership does not containMembershipData::created_ts. (origin_server_tswill be ignored ifMembershipData::created_tsisSome)
pub fn memberships(&self) -> Vec<MembershipData<'_>>
pub fn memberships(&self) -> Vec<MembershipData<'_>>
All the memberships for this event. Can only contain multiple elements in the case of legacy
m.call.member state events.
pub fn set_created_ts_if_none(
&mut self,
origin_server_ts: MilliSecondsSinceUnixEpoch,
)
pub fn set_created_ts_if_none( &mut self, origin_server_ts: MilliSecondsSinceUnixEpoch, )
Set the created_ts in this event.
Each call member event contains the origin_server_ts and content.create_ts.
content.create_ts is undefined for the initial event of a session (because the
origin_server_ts is not known on the client).
In the rust sdk we want to copy over the origin_server_ts of the event into the content.
(This allows to use MinimalStateEvents and still be able to determine if a membership is
expired)
Trait Implementations§
§impl Clone for CallMemberEventContent
impl Clone for CallMemberEventContent
§fn clone(&self) -> CallMemberEventContent
fn clone(&self) -> CallMemberEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for CallMemberEventContent
impl Debug for CallMemberEventContent
§impl<'de> Deserialize<'de> for CallMemberEventContent
impl<'de> Deserialize<'de> for CallMemberEventContent
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl From<CallMemberEventContent> for AnyStateEventContent
impl From<CallMemberEventContent> for AnyStateEventContent
§fn from(c: CallMemberEventContent) -> AnyStateEventContent
fn from(c: CallMemberEventContent) -> AnyStateEventContent
§impl PartialEq for CallMemberEventContent
impl PartialEq for CallMemberEventContent
§impl PossiblyRedactedStateEventContent for CallMemberEventContent
impl PossiblyRedactedStateEventContent for CallMemberEventContent
§type StateKey = CallMemberStateKey
type StateKey = CallMemberStateKey
state_key field.§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name.§impl RedactContent for CallMemberEventContent
impl RedactContent for CallMemberEventContent
§type Redacted = RedactedCallMemberEventContent
type Redacted = RedactedCallMemberEventContent
§fn redact(
self,
_rules: &RedactionRules,
) -> <CallMemberEventContent as RedactContent>::Redacted
fn redact( self, _rules: &RedactionRules, ) -> <CallMemberEventContent as RedactContent>::Redacted
self into a redacted form (removing most or all fields) according to the spec. Read more§impl Serialize for CallMemberEventContent
impl Serialize for CallMemberEventContent
§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,
§impl StateEventContent for CallMemberEventContent
impl StateEventContent for CallMemberEventContent
§type StateKey = CallMemberStateKey
type StateKey = CallMemberStateKey
state_key field.§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name.§impl StaticStateEventContent for CallMemberEventContent
impl StaticStateEventContent for CallMemberEventContent
§type PossiblyRedacted = CallMemberEventContent
type PossiblyRedacted = CallMemberEventContent
§type Unsigned = StateUnsigned<<CallMemberEventContent as StaticStateEventContent>::PossiblyRedacted>
type Unsigned = StateUnsigned<<CallMemberEventContent as StaticStateEventContent>::PossiblyRedacted>
unsigned field.impl JsonCastable<AnyStateEventContent> for CallMemberEventContent
impl JsonCastable<Map<String, Value>> for CallMemberEventContent
impl StructuralPartialEq for CallMemberEventContent
Auto Trait Implementations§
impl Freeze for CallMemberEventContent
impl RefUnwindSafe for CallMemberEventContent
impl Send for CallMemberEventContent
impl Sync for CallMemberEventContent
impl Unpin for CallMemberEventContent
impl UnwindSafe for CallMemberEventContent
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> DeserialiseFromJs for Twhere
T: DeserializeOwned,
impl<T> DeserialiseFromJs for Twhere
T: DeserializeOwned,
§fn deserialise_from_js(js: JsValue) -> Result<T, Error>
fn deserialise_from_js(js: JsValue) -> Result<T, Error>
serde_wasm_bindgen.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> SerialiseToJs for Twhere
T: Serialize,
impl<T> SerialiseToJs for Twhere
T: Serialize,
§fn serialise_to_js(&self) -> Result<JsValue, Error>
fn serialise_to_js(&self) -> Result<JsValue, Error>
JsValue, most likely using serde_wasm_bindgen.