pub struct Session {Show 14 fields
client: TokioDrop<BoxedClient>,
sidebar_list_model: OnceCell<SidebarListModel>,
user: OnceCell<User>,
state: Cell<SessionState>,
is_homeserver_reachable: Cell<bool>,
is_offline: Cell<bool>,
settings: OnceCell<SessionSettings>,
notifications: Notifications,
ignored_users: IgnoredUsers,
user_sessions: UserSessionsList,
security: SessionSecurity,
sync_handle: RefCell<Option<AbortHandle>>,
network_monitor_handler_id: RefCell<Option<SignalHandlerId>>,
missed_sync_count: Cell<u8>,
}
Fields§
§client: TokioDrop<BoxedClient>
The Matrix client.
The list model of the sidebar.
user: OnceCell<User>
The user of this session.
state: Cell<SessionState>
The current state of the session.
is_homeserver_reachable: Cell<bool>
Whether this session has a connection to the homeserver.
is_offline: Cell<bool>
Whether this session is synchronized with the homeserver.
settings: OnceCell<SessionSettings>
The current settings for this session.
notifications: Notifications
The notifications API for this session.
ignored_users: IgnoredUsers
The ignored users API for this session.
user_sessions: UserSessionsList
The list of sessions for this session’s user.
security: SessionSecurity
Information about security for this session.
sync_handle: RefCell<Option<AbortHandle>>
§network_monitor_handler_id: RefCell<Option<SignalHandlerId>>
§missed_sync_count: Cell<u8>
The number of missed synchonizations in a row.
Capped at MISSED_SYNC_MAX_COUNT - 1
.
Implementations§
Source§impl Session
impl Session
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl Session
impl Session
pub(super) fn client(&self) -> &Client
The list model of the sidebar.
Sourcepub(super) fn verification_list(&self) -> VerificationList
pub(super) fn verification_list(&self) -> VerificationList
The verification list of this session.
Sourcefn set_state(&self, state: SessionState)
fn set_state(&self, state: SessionState)
Set the current state of the session.
Sourcepub(super) async fn update_homeserver_reachable(&self)
pub(super) async fn update_homeserver_reachable(&self)
Update whether the homeserver is reachable.
Sourcepub(super) fn set_offline(&self, is_offline: bool)
pub(super) fn set_offline(&self, is_offline: bool)
Set whether this session is synchronized with the homeserver.
Sourceasync fn handle_sync_response(&self, response: Result<SyncResponse, Error>)
async fn handle_sync_response(&self, response: Result<SyncResponse, Error>)
Handle the response received via sync.
Sourceasync fn init_user_profile(&self)
async fn init_user_profile(&self)
Load the cached profile of the user of this session.
Sourceasync fn update_user_profile(&self)
async fn update_user_profile(&self)
Update the profile of this session’s user.
Fetches the updated profile and updates the local data.
Sourcefn init_notifications(&self)
fn init_notifications(&self)
Start listening to notifications.
Trait Implementations§
Source§impl DerivedObjectProperties for Session
impl DerivedObjectProperties for Session
Source§fn derived_properties() -> &'static [ParamSpec]
fn derived_properties() -> &'static [ParamSpec]
Source§fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
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)
fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.Source§impl ObjectImpl for Session
impl ObjectImpl for Session
Source§fn constructed(&self)
fn constructed(&self)
Source§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
Source§fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
Source§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
self.notify("property")
.fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Source§impl ObjectSubclass for Session
impl ObjectSubclass for Session
Source§type Interfaces = ()
type Interfaces = ()
Source§type ParentType = SessionInfo
type ParentType = SessionInfo
Source§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
Source§fn type_init(_type_: &mut InitializingType<Self>)
fn type_init(_type_: &mut InitializingType<Self>)
Source§fn class_init(_klass: &mut Self::Class)
fn class_init(_klass: &mut Self::Class)
Source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
Source§fn instance_init(_obj: &InitializingObject<Self>)
fn instance_init(_obj: &InitializingObject<Self>)
Source§impl ObjectSubclassType for Session
impl ObjectSubclassType for Session
Source§impl SessionInfoImpl for Session
impl SessionInfoImpl for Session
fn avatar_data(&self) -> AvatarData
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Send for Session
impl !Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
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, 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 moreSource§impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
Source§fn parent_constructed(&self)
fn parent_constructed(&self)
glib::Object::constructed()
.Source§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
glib::Object::notify()
.Source§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
glib::Object::dispatch_properties_changed()
.Source§fn signal_chain_from_overridden(
&self,
token: &SignalClassHandlerToken,
values: &[Value],
) -> Option<Value>
fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>
Source§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
Source§fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
Source§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
Source§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
self
.