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:
- the innermost
scopedset on this thread — a process running several apps wraps each app’s dispatch so its effects reach that app’s services; - the default an app process installed with
install_default; ProcessServices::null, which performs nothing outside the process.
The existing free functions (text_selection::clipboard_copy,
portal::PickRequest::send, widget::try_open_external_url, …) 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§
- Accessibility
Inputs - Continuation
Metadata - 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.
- InProcess
Secrets - Secrets in one map that lives as long as the provider, for processes that keep nothing outside the process.
- Media
Session - 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
- Process
Environment - Process
Identity - Who this process is and which workspace it serves; every field is optional, and each reader applies its own fallback.
- Process
Paths - Process
Recorder - What a
ProcessServices::recordingprocess was asked to do, and the answers it will give. - Process
Scope - Keeps a set of services
currenton this thread; seeenter. - Process
Services - Everything a
uiprocess may ask of its process. - Runner
Diagnostics - Secret
Store
Enums§
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§
- File
Picker - Media
Session Factory - Starts media-control sessions for players such as the
VideoPlayerwidget. - Media
Session Publisher - Receives player state for the process’s media controls.
- Notifier
- Screen
Capture Provider - Process-provided screen capture.
- Secret
Backend - Secrets
Provider - Opens an app’s secret store: the system’s, or a process’s own.
- Speech
Factory - 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
servicescurrenton 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
servicesas 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 aLANGUAGElist such asde:en_US, whose first entry wins) as a language identifier.C,POSIX, empty and malformed values name none. - scoped
- Run
fwithservicesascurrenton this thread.