Skip to main content

Module process

Module process 

Source
Expand description

Process services — the capabilities an app borrows from its process.

Widgets and apps reach the clipboard, file choosers, URI handlers, speech, notifications and media controls through ProcessServices instead of calling a platform API directly. The same toolkit then runs under the native desktop runner, inside an app process such as the compositor’s, or in a test that records every effect instead of performing it.

§Resolution

current answers, in order:

  1. the innermost scoped set on this thread — a process running several apps wraps each app’s dispatch so its effects reach that app’s services;
  2. the default an app process installed with install_default;
  3. ProcessServices::null, which performs nothing outside the process.

The existing free functions (text_selection::clipboard_copy, portal::PickRequest::send, ui::platform::try_os_open, …) resolve through current, so apps need no changes. New code that holds a ui::application::ProcessContext can use its services() directly.

Re-exports§

pub use crate::location::LocationProvider;

Modules§

environment
Process inputs: who the process is and where its files live, kept with the current process (tilo_process::environment). Host inputs: who the process is, where its files live, and how its user asked to be served.

Structs§

AccessibilityInputs
ContinuationMetadata
Inert, app-owned resume projection sent only to the local shell: the bytes are opaque to the toolkit, so each app can version its own schema, and the shell validates size and path redaction before keeping them.
InProcessSecrets
Secrets in one map that lives as long as the provider, for processes that keep nothing outside the process.
MediaSession
A live media-control session: commands from the process (media keys, a now-playing widget) and the sink the player publishes its state into.
Notification
ProcessEnvironment
ProcessIdentity
Who this process is and which workspace it serves; every field is optional, and each reader applies its own fallback.
ProcessPaths
ProcessRecorder
What a ProcessServices::recording process was asked to do, and the answers it will give.
ProcessScope
Keeps a set of services current on this thread; see enter.
ProcessServices
Everything a ui process may ask of its process.
RunnerDiagnostics
SecretStore

Enums§

NotifyError

Constants§

NO_WINDOW_ENV
The variable a launch sets (1) for a process started with no window: the app takes its actions and publishes what it offers, and makes a window only once a shell asks it for one.
NO_WINDOW_IDLE_ENV
The seconds a process the daemon started with no window runs on with no call for, after which it ends: the daemon starts it again on the next call. A process the session starts with no window is given none, and runs until the session ends it.
REVEAL_ENV

Traits§

FilePicker
MediaSessionFactory
Starts media-control sessions for players such as the VideoPlayer widget.
MediaSessionPublisher
Receives player state for the process’s media controls.
Notifier
ScreenCaptureProvider
Process-provided screen capture.
SecretBackend
SecretsProvider
Opens an app’s secret store: the system’s, or a process’s own.
SpeechFactory
Creates the speech output the built-in screen reader narrates through.
UriOpener

Functions§

current
The services effects on this thread should reach right now; see the module docs for the resolution order.
enter
Make services current on this thread until the returned guard drops.
environment
The host inputs for this process: the installed ones, else (with native) what the runner reads from the process environment afresh on each call, else none.
install_default
Install services as this process’s default, replacing any earlier one.
install_default_if_unset
Install make() as the default unless one is already installed. Returns whether it installed.
install_environment
installed_default
parse_posix_locale
A POSIX locale value (de_DE.UTF-8, or a LANGUAGE list such as de:en_US, whose first entry wins) as a language identifier. C, POSIX, empty and malformed values name none.
scoped
Run f with services as current on this thread.