pub struct Session {Show 19 fields
client: OnceCell<TokioDrop<Client>>,
sidebar_list_model: OnceCell<SidebarListModel>,
user: OnceCell<User>,
state: Cell<SessionState>,
is_homeserver_reachable: Cell<bool>,
is_offline: Cell<bool>,
settings: OnceCell<SessionSettings>,
global_account_data: OnceCell<GlobalAccountData>,
notifications: Notifications,
ignored_users: IgnoredUsers,
user_sessions: UserSessionsList,
security: SessionSecurity,
remote_cache: OnceCell<RemoteCache>,
session_changes_handle: RefCell<Option<AbortHandle>>,
sync_handle: RefCell<Option<AbortHandle>>,
network_monitor_handler_id: RefCell<Option<SignalHandlerId>>,
homeserver_reachable_lock: Mutex<()>,
homeserver_reachable_source: RefCell<Option<SourceId>>,
missed_sync_count: Cell<usize>,
}Fields§
§client: OnceCell<TokioDrop<Client>>The Matrix client for this session.
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.
global_account_data: OnceCell<GlobalAccountData>The settings in the global account data for this session.
notifications: NotificationsThe notifications API for this session.
ignored_users: IgnoredUsersThe ignored users API for this session.
user_sessions: UserSessionsListThe list of sessions for this session’s user.
security: SessionSecurityInformation about security for this session.
remote_cache: OnceCell<RemoteCache>The cache for remote data.
session_changes_handle: RefCell<Option<AbortHandle>>§sync_handle: RefCell<Option<AbortHandle>>§network_monitor_handler_id: RefCell<Option<SignalHandlerId>>§homeserver_reachable_lock: Mutex<()>§homeserver_reachable_source: RefCell<Option<SourceId>>§missed_sync_count: Cell<usize>The number of missed synchronizations in a row.
Capped at MISSED_SYNC_DELAYS.len() - 1.
Implementations§
Source§impl Session
impl Session
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl Session
impl Session
Sourcepub(super) fn set_client(&self, client: Client)
pub(super) fn set_client(&self, client: Client)
Set the Matrix client for this session.
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.
Sourcefn homeserver_address(&self) -> NetworkAddress
fn homeserver_address(&self) -> NetworkAddress
The homeserver URL as a GNetworkAddress.
Sourcepub(super) async fn update_homeserver_reachable(&self)
pub(super) async fn update_homeserver_reachable(&self)
Check whether the homeserver is reachable.
Sourcefn set_is_homeserver_reachable(&self, is_reachable: bool)
fn set_is_homeserver_reachable(&self, is_reachable: bool)
Set 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.
Sourcefn global_account_data(&self) -> &GlobalAccountData
fn global_account_data(&self) -> &GlobalAccountData
The settings stored in the global account data for this session.
Sourcefn global_account_data_owned(&self) -> GlobalAccountData
fn global_account_data_owned(&self) -> GlobalAccountData
The owned settings stored in the global account data for this session.
Sourcepub(super) fn remote_cache(&self) -> &RemoteCache
pub(super) fn remote_cache(&self) -> &RemoteCache
The cache for remote data.
Sourcefn watch_session_changes(&self)
fn watch_session_changes(&self)
Watch the changes of the session, like being logged out or the tokens being refreshed.
Sourcefn handle_sync_response(
&self,
response: Result<SyncResponse, Error>,
) -> Option<Duration>
fn handle_sync_response( &self, response: Result<SyncResponse, Error>, ) -> Option<Duration>
Handle the response received via sync.
Returns the delay to wait for before making the next sync, if necessary.
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.
Sourceasync fn store_tokens(&self)
async fn store_tokens(&self)
Update the stored session tokens.
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 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 constructed(&self)
fn constructed(&self)
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 UnsafeUnpin 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 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.