fractal::session::model::room::imp

Struct Room

source
pub struct Room {
Show 39 fields matrix_room: OnceCell<Room>, session: WeakRef<Session>, room_id_string: PhantomData<String>, aliases: RoomAliases, name: RefCell<Option<String>>, has_avatar: Cell<bool>, topic: RefCell<Option<String>>, topic_linkified: RefCell<Option<String>>, category: Cell<RoomCategory>, is_direct: Cell<bool>, is_tombstoned: Cell<bool>, pub(super) predecessor_id: OnceCell<OwnedRoomId>, predecessor_id_string: PhantomData<Option<String>>, pub(super) successor_id: OnceCell<OwnedRoomId>, successor_id_string: PhantomData<Option<String>>, successor: WeakRef<Room>, pub(super) members: WeakRef<MemberList>, members_drop_guard: OnceCell<EventHandlerDropGuard>, joined_members_count: Cell<u64>, own_member: OnceCell<Member>, inviter: RefCell<Option<Member>>, direct_member: RefCell<Option<Member>>, timeline: OnceCell<Timeline>, latest_activity: Cell<u64>, is_read: Cell<bool>, notification_count: Cell<u64>, has_notifications: Cell<bool>, highlight: Cell<HighlightFlags>, is_encrypted: Cell<bool>, join_rule: JoinRule, guests_allowed: Cell<bool>, history_visibility: Cell<HistoryVisibilityValue>, version: PhantomData<String>, federated: PhantomData<bool>, typing_list: TypingList, typing_drop_guard: OnceCell<EventHandlerDropGuard>, notifications_setting: Cell<NotificationsRoomSetting>, permissions: Permissions, verification: BoundObjectWeakRef<IdentityVerification>,
}

Fields§

§matrix_room: OnceCell<Room>

The room API of the SDK.

§session: WeakRef<Session>

The current session.

§room_id_string: PhantomData<String>

The ID of this room, as a string.

§aliases: RoomAliases

The aliases of this room.

§name: RefCell<Option<String>>

The name that is set for this room.

This can be empty, the display name should be used instead in the interface.

§has_avatar: Cell<bool>

Whether this room has an avatar explicitly set.

This is false if there is no avatar or if the avatar is the one from the other member.

§topic: RefCell<Option<String>>

The topic of this room.

§topic_linkified: RefCell<Option<String>>

The linkified topic of this room.

This is the string that should be used in the interface when markup is allowed.

§category: Cell<RoomCategory>

The category of this room.

§is_direct: Cell<bool>

Whether this room is a direct chat.

§is_tombstoned: Cell<bool>

Whether this room has been upgraded.

§predecessor_id: OnceCell<OwnedRoomId>

The ID of the room that was upgraded and that this one replaces.

§predecessor_id_string: PhantomData<Option<String>>

The ID of the room that was upgraded and that this one replaces, as a string.

§successor_id: OnceCell<OwnedRoomId>

The ID of the successor of this Room, if this room was upgraded.

§successor_id_string: PhantomData<Option<String>>

The ID of the successor of this Room, if this room was upgraded, as a string.

§successor: WeakRef<Room>

The successor of this Room, if this room was upgraded and the successor was joined.

§members: WeakRef<MemberList>

The members of this room.

§members_drop_guard: OnceCell<EventHandlerDropGuard>§joined_members_count: Cell<u64>

The number of joined members in the room, according to the homeserver.

§own_member: OnceCell<Member>

The member corresponding to our own user.

§inviter: RefCell<Option<Member>>

The user who sent the invite to this room.

This is only set when this room is an invitation.

§direct_member: RefCell<Option<Member>>

The other member of the room, if this room is a direct chat and there is only one other member.

§timeline: OnceCell<Timeline>

The timeline of this room.

§latest_activity: Cell<u64>

The timestamp of the room’s latest activity.

This is the timestamp of the latest event that counts as possibly unread.

If it is not known, it will return 0.

§is_read: Cell<bool>

Whether all messages of this room are read.

§notification_count: Cell<u64>

The number of unread notifications of this room.

§has_notifications: Cell<bool>

whether this room has unread notifications.

§highlight: Cell<HighlightFlags>

The highlight state of the room.

§is_encrypted: Cell<bool>

Whether this room is encrypted.

§join_rule: JoinRule

The join rule of this room.

§guests_allowed: Cell<bool>

Whether guests are allowed.

§history_visibility: Cell<HistoryVisibilityValue>

The visibility of the history.

§version: PhantomData<String>

The version of this room.

§federated: PhantomData<bool>

Whether this room is federated.

§typing_list: TypingList

The list of members currently typing in this room.

§typing_drop_guard: OnceCell<EventHandlerDropGuard>§notifications_setting: Cell<NotificationsRoomSetting>

The notifications settings for this room.

§permissions: Permissions

The permissions of our own user in this room

§verification: BoundObjectWeakRef<IdentityVerification>

An ongoing identity verification in this room.

Implementations§

source§

impl Room

source

fn register_type()

Registers the type only once.

source§

impl Room

source

pub fn downgrade(&self) -> <Self as Downgrade>::Weak

source§

impl Room

source

pub(super) fn init( &self, matrix_room: MatrixRoom, metainfo: Option<RoomMetainfo>, )

Initialize this room.

source

pub(super) fn matrix_room(&self) -> &MatrixRoom

The room API of the SDK.

source

fn set_session(&self, session: Session)

Set the current session

source

pub fn room_id(&self) -> &RoomId

The ID of this room.

source

fn room_id_string(&self) -> String

The ID of this room, as a string.

source

fn update_name(&self)

Update the name of this room.

source

async fn update_display_name(&self)

Load the display name from the SDK.

source

fn set_has_avatar(&self, has_avatar: bool)

Set whether this room has an avatar explicitly set.

source

fn update_avatar(&self)

Update the avatar of the room.

source

fn update_topic(&self)

Update the topic of this room.

source

pub(super) fn set_category(&self, category: RoomCategory)

Set the category of this room.

source

pub(super) fn update_category(&self)

Update the category from the SDK.

source

async fn set_is_direct(&self, is_direct: bool)

Set whether this room is a direct chat.

source

pub(super) async fn update_is_direct(&self)

Update whether the room is direct or not.

source

fn update_tombstone(&self)

Update the tombstone for this room.

source

pub(super) fn update_successor(&self)

Update the successor of this room.

source

fn predecessor_id_string(&self) -> Option<String>

The ID of the room that was upgraded and that this one replaces, as a string.

source

fn load_predecessor(&self)

Load the predecessor of this room.

source

fn successor_id_string(&self) -> Option<String>

The ID of the successor of this room, if this room was upgraded.

source

fn set_successor(&self, successor: &Room)

Set the successor of this room.

source

fn watch_members(&self)

Watch changes in the members list.

source

fn handle_member_event(&self, event: SyncRoomMemberEvent)

Handle a member event received via sync

source

fn set_joined_members_count(&self, count: u64)

Set the number of joined members in the room, according to the homeserver.

source

fn own_member(&self) -> &Member

The member corresponding to our own user.

source

async fn load_own_member(&self)

Load our own member from the store.

source

async fn load_inviter(&self)

Load the member that invited us to this room, when applicable.

source

fn set_direct_member(&self, member: Option<Member>)

Set the other member of the room, if this room is a direct chat and there is only one other member..

source

async fn direct_user_id(&self) -> Option<OwnedUserId>

The ID of the other user, if this is a direct chat and there is only one other user.

source

async fn update_direct_member(&self)

Update the other member of the room, if this room is a direct chat and there is only one other member.

source

fn init_timeline(&self)

Initialize the timeline of this room.

source

pub(super) fn set_latest_activity(&self, latest_activity: u64)

Set the timestamp of the room’s latest possibly unread event.

source

fn set_is_read(&self, is_read: bool)

Set whether all messages of this room are read.

source

async fn handle_read_change_trigger(&self)

Handle the trigger emitted when a read change might have occurred.

source

fn set_highlight(&self, highlight: HighlightFlags)

Set how this room is highlighted.

source

fn update_highlight(&self)

Update the highlight of the room from the current state.

source

fn set_notification_count(&self, count: u64)

Set the number of unread notifications of this room.

source

fn set_has_notifications(&self, has_notifications: bool)

Set whether this room has unread notifications.

source

async fn update_is_encrypted(&self)

Update whether the room is encrypted from the SDK.

source

fn update_guests_allowed(&self)

Update whether guests are allowed.

source

fn update_history_visibility(&self)

Update the visibility of the history.

source

fn version(&self) -> String

The version of this room.

source

fn federated(&self) -> bool

Whether this room is federated.

source

fn set_up_typing(&self)

Start listening to typing events.

source

fn update_typing_list(&self, typing_user_ids: Vec<OwnedUserId>)

Update the typing list with the given user IDs.

source

fn set_notifications_setting(&self, setting: NotificationsRoomSetting)

Set the notifications setting for this room.

source

fn set_verification(&self, verification: Option<IdentityVerification>)

Set an ongoing verification in this room.

source

fn watch_room_info(&self)

Watch the SDK’s room info for changes to the room state.

source

async fn update_with_room_info(&self, room_info: RoomInfo)

Update this room with the given SDK room info.

source

pub(super) fn handle_ambiguity_changes<'a>( &self, changes: impl Iterator<Item = &'a AmbiguityChange>, )

Handle changes in the ambiguity of members display names.

source

async fn watch_send_queue(&self)

Watch errors in the send queue to try to handle them.

Trait Implementations§

source§

impl Default for Room

source§

fn default() -> Room

Returns the “default value” for a type. Read more
source§

impl DerivedObjectProperties for Room

source§

fn derived_properties() -> &'static [ParamSpec]

Properties installed for this type.
source§

fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value

Similar to ObjectImpl but auto-generated by the Properties macro to allow handling more complex use-cases.
source§

fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)

Similar to ObjectImpl but auto-generated by the Properties macro to allow handling more complex use-cases.
source§

impl ObjectImpl for Room

source§

fn signals() -> &'static [Signal]

Signals installed for this type.
source§

fn properties() -> &'static [ParamSpec]

Properties installed for this type.
source§

fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)

Property setter. Read more
source§

fn property(&self, id: usize, pspec: &ParamSpec) -> Value

Property getter. Read more
source§

fn constructed(&self)

Constructed. Read more
source§

fn dispose(&self)

Disposes of the object. Read more
source§

fn notify(&self, pspec: &ParamSpec)

Function to be called when property change is notified for with self.notify("property").
source§

fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])

source§

impl ObjectSubclass for Room

source§

const NAME: &'static str = "Room"

GObject type name. Read more
source§

type Interfaces = ()

List of interfaces implemented by this type.
source§

type Class = ClassStruct<Room>

The C class struct. Read more
source§

type Instance = InstanceStruct<Room>

The C instance struct. Read more
source§

type Type = Room

Wrapper around this subclass defined with wrapper!
source§

type ParentType = PillSource

Parent Rust type to inherit from.
source§

fn new() -> Self

Constructor. Read more
source§

const ABSTRACT: bool = false

If this subclass is an abstract class or not. Read more
source§

const ALLOW_NAME_CONFLICT: bool = false

Allow name conflicts for this class. Read more
source§

fn type_init(_type_: &mut InitializingType<Self>)

Additional type initialization. Read more
source§

fn class_init(_klass: &mut Self::Class)

Class initialization. Read more
source§

fn with_class(_klass: &Self::Class) -> Self

Constructor. Read more
source§

fn instance_init(_obj: &InitializingObject<Self>)

Performs additional instance initialization. Read more
source§

impl ObjectSubclassType for Room

source§

fn type_data() -> NonNull<TypeData>

Storage for the type-specific data used during registration.
source§

fn type_() -> Type

Returns the glib::Type ID of the subclass. Read more
source§

impl PillSourceImpl for Room

source§

fn identifier(&self) -> String

A unique identifier for this source.

Auto Trait Implementations§

§

impl !Freeze for Room

§

impl !RefUnwindSafe for Room

§

impl !Send for Room

§

impl !Sync for Room

§

impl Unpin for Room

§

impl !UnwindSafe for Room

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> 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> NoneValue for T
where T: Default,

source§

type NoneType = T

source§

fn null_value() -> T

The none-equivalent value.
source§

impl<T> ObjectImplExt for T
where T: ObjectImpl,

source§

fn parent_constructed(&self)

Chain up to the parent class’ implementation of glib::Object::constructed().
source§

fn parent_notify(&self, pspec: &ParamSpec)

Chain up to the parent class’ implementation of glib::Object::notify().
source§

fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])

Chain up to the parent class’ implementation of glib::Object::dispatch_properties_changed().
source§

fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>

Chain up to parent class signal handler.
source§

impl<T> ObjectSubclassExt for T
where T: ObjectSubclass,

source§

fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>

👎Deprecated: Use obj() instead
Returns the corresponding object instance.
source§

fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T

👎Deprecated: Use from_obj() instead
Returns the implementation from an instance.
source§

fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>

Returns the corresponding object instance. Read more
source§

fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T

Returns the implementation from an instance. Read more
source§

fn ref_counted(&self) -> ObjectImplRef<T>

Returns a new reference-counted wrapper around self.
source§

fn instance_data<U>(&self, type_: Type) -> Option<&U>
where U: Any + Send + Sync + 'static,

Returns a pointer to the instance implementation specific data. 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> Same for T

source§

type Output = T

Should always be Self
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> Any for T
where T: Any,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,