Skip to main content

RoomInfo

Struct RoomInfo 

Source
pub struct RoomInfo { /* private fields */ }
Expand description

The underlying pure data structure for joined and left rooms.

Holds all the info needed to persist a room into the state store.

Implementations§

Source§

impl RoomInfo

Source

pub fn mark_as_joined(&mut self)

Mark this Room as joined.

Source

pub fn mark_as_left(&mut self)

Mark this Room as left.

Source

pub fn mark_as_invited(&mut self)

Mark this Room as invited.

Source

pub fn mark_as_knocked(&mut self)

Mark this Room as knocked.

Source

pub fn mark_as_banned(&mut self)

Mark this Room as banned.

Source

pub fn set_state(&mut self, room_state: RoomState)

Set the membership RoomState of this Room

Source

pub fn mark_members_synced(&mut self)

Mark this Room as having all the members synced.

Source

pub fn mark_members_missing(&mut self)

Mark this Room as still missing member information.

Source

pub fn are_members_synced(&self) -> bool

Returns whether the room members are synced.

Source

pub fn mark_state_partially_synced(&mut self)

Mark this Room as still missing some state information.

Source

pub fn mark_state_fully_synced(&mut self)

Mark this Room as still having all state synced.

Source

pub fn mark_state_not_synced(&mut self)

Mark this Room as still having no state synced.

Source

pub fn mark_encryption_state_synced(&mut self)

Mark this Room as having the encryption state synced.

Source

pub fn mark_encryption_state_missing(&mut self)

Mark this Room as still missing encryption state information.

Source

pub fn set_prev_batch(&mut self, prev_batch: Option<&str>) -> bool

Set the prev_batch-token. Returns whether the token has differed and thus has been upgraded: false means no update was applied as the were the same

Source

pub fn state(&self) -> RoomState

Returns the state this room is in.

Source

pub fn encryption_state(&self) -> EncryptionState

Available on non-crate feature experimental-encrypted-state-events only.

Returns the encryption state of this room.

Source

pub fn set_encryption_event( &mut self, event: Option<PossiblyRedactedRoomEncryptionEventContent>, )

Set the encryption event content in this room.

Source

pub fn handle_encryption_state( &mut self, requested_required_states: &[(StateEventType, String)], )

Handle the encryption state.

Source

pub fn handle_state_event( &mut self, raw_event: &mut RawStateEventWithKeys<AnySyncStateEvent>, ) -> bool

Handle the given state event.

Returns true if the event modified the info, false otherwise.

Source

pub fn handle_stripped_state_event( &mut self, raw_event: &mut RawStateEventWithKeys<AnyStrippedStateEvent>, ) -> bool

Handle the given stripped state event.

Returns true if the event modified the info, false otherwise.

Source

pub fn handle_redaction( &mut self, event: &SyncRoomRedactionEvent, _raw: &Raw<SyncRoomRedactionEvent>, )

Handle the given redaction.

Source

pub fn avatar_url(&self) -> Option<&MxcUri>

Returns the current room avatar.

Source

pub fn update_avatar(&mut self, url: Option<OwnedMxcUri>)

Update the room avatar.

Source

pub fn avatar_info(&self) -> Option<&ImageInfo>

Returns information about the current room avatar.

Source

pub fn update_notification_count( &mut self, notification_counts: UnreadNotificationsCount, )

Update the notifications count.

Source

pub fn update_from_ruma_summary(&mut self, summary: &RoomSummary) -> bool

Update the RoomSummary from a Ruma RoomSummary.

Returns true if any field has been updated, false otherwise.

Source

pub fn heroes(&self) -> &[RoomHero]

The heroes for this room.

Source

pub fn active_members_count(&self) -> u64

The number of active members (invited + joined) in the room.

The return value is saturated at u64::MAX.

Source

pub fn invited_members_count(&self) -> u64

The number of invited members in the room

Source

pub fn joined_members_count(&self) -> u64

The number of joined members in the room

Source

pub fn canonical_alias(&self) -> Option<&RoomAliasId>

Get the canonical alias of this room.

Source

pub fn alt_aliases(&self) -> &[OwnedRoomAliasId]

Get the alternative aliases of this room.

Source

pub fn room_id(&self) -> &RoomId

Get the room ID of this room.

Source

pub fn room_version(&self) -> Option<&RoomVersionId>

Get the room version of this room.

Source

pub fn room_version_rules_or_default(&self) -> RoomVersionRules

Get the room version rules of this room, or a sensible default.

Will warn (at most once) if the room create event is missing from this RoomInfo or if the room version is unsupported.

Source

pub fn room_type(&self) -> Option<&RoomType>

Get the room type of this room.

Source

pub fn creators(&self) -> Option<Vec<OwnedUserId>>

Get the creators of this room.

Source

pub fn history_visibility(&self) -> Option<&HistoryVisibility>

Returns the history visibility for this room.

Returns None if the event was never seen during sync.

Source

pub fn history_visibility_or_default(&self) -> &HistoryVisibility

Returns the history visibility for this room, or a sensible default.

Returns Shared, the default specified by the spec, when the event is missing.

Source

pub fn join_rule(&self) -> Option<&JoinRule>

Return the join rule for this room, if the m.room.join_rules event is available.

Source

pub fn service_members(&self) -> Option<&BTreeSet<OwnedUserId>>

Return the service members for this room if the m.member_hints event is available

Source

pub fn name(&self) -> Option<&str>

Get the name of this room.

Source

pub fn create(&self) -> Option<&RoomCreateWithCreatorEventContent>

Get the content of the m.room.create event if any.

Source

pub fn tombstone(&self) -> Option<&PossiblyRedactedRoomTombstoneEventContent>

Get the content of the m.room.tombstone event if any.

Source

pub fn topic(&self) -> Option<&str>

Returns the topic for this room, if set.

Source

pub fn has_active_room_call(&self) -> bool

Is there a non expired membership with application “m.call” and scope “m.room” in this room.

Source

pub fn active_room_call_consensus_intent(&self) -> CallIntentConsensus

Get the call intent consensus for the current call, based on what members are advertising.

This provides detailed information about the consensus state (is it an audio or video call), including whether it’s full (all members agree) or partial (only some members advertise), allowing callers to distinguish between different levels of consensus.

§Returns
Source

pub fn active_room_call_participants(&self) -> Vec<OwnedUserId>

Returns a Vec of userId’s that participate in the room call.

matrix_rtc memberships with application “m.call” and scope “m.room” are considered. A user can occur twice if they join with two devices. convert to a set depending if the different users are required or the amount of sessions.

The vector is ordered by oldest membership user to newest.

Source

pub fn set_latest_event(&mut self, new_value: LatestEventValue)

Sets the new LatestEventValue.

Source

pub fn update_recency_stamp(&mut self, stamp: RoomRecencyStamp)

Updates the recency stamp of this room.

Please read Self::recency_stamp to learn more.

Source

pub fn pinned_event_ids(&self) -> Option<Vec<OwnedEventId>>

Returns the current pinned event ids for this room.

Source

pub fn is_pinned_event(&self, event_id: &EventId) -> bool

Checks if an EventId is currently pinned. It avoids having to clone the whole list of event ids to check a single value.

Returns true if the provided event_id is pinned, false otherwise.

Source

pub fn read_receipts(&self) -> &RoomReadReceipts

Returns the computed read receipts for this room.

Source

pub fn set_read_receipts(&mut self, read_receipts: RoomReadReceipts)

Set the computed read receipts for this room.

Trait Implementations§

Source§

impl Clone for RoomInfo

Source§

fn clone(&self) -> RoomInfo

Returns a duplicate 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 RoomInfo

Source§

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

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

impl<'de> Deserialize<'de> for RoomInfo

Source§

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

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

impl Serialize for RoomInfo

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

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, dest: *mut u8)

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

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> DeserialiseFromJs for T

Source§

fn deserialise_from_js(js: JsValue) -> Result<T, Error>

Deserialise a value from JS, most likely using serde_wasm_bindgen.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
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>).
§

impl<T> Instrument for T

§

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

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

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerialiseToJs for T
where T: Serialize,

Source§

fn serialise_to_js(&self) -> Result<JsValue, Error>

Convert the type to a JsValue, most likely using serde_wasm_bindgen.
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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

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

Source§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Any for T
where T: Any,

§

impl<T> AsyncTraitDeps for T

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

Source§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,

Source§

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

Source§

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

Source§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> JsonCastable<CanonicalJsonValue> for T

§

impl<T> JsonCastable<Value> for T

Source§

impl<T> MaybeSendSync for T

§

impl<T> SendOutsideWasm for T
where T: Send,

§

impl<T> SyncOutsideWasm for T
where T: Sync,