Skip to main content

Crate tilo_paths

Crate tilo_paths 

Source
Expand description

Where per-user data, configuration, state, cache and runtime files live.

AppPaths::for_app gives an app its data, config, cache, state and runtime locations, the user’s folders, the workspace and the font catalog, on every target; the functions here are the same base directories for code without an app.

Modules§

desktop_service
Where a desktop’s own workspace service kept its state, before the device’s daemon kept its person’s workspaces: what the session hands over once, and what root reads at sign-in to tell the daemon that the session is about to.
login
Whether this process runs inside a Tilo login, and where that login’s compositor publishes its endpoints: the private SESSION_DIR under the login’s runtime directory.
session
Who the app runs as and on what: the login’s account and host names, and whether a desktop session is there to show capture and call UI.
xdg

Structs§

AppDirs
One app’s subdirectories of the per-user base directories, e.g. AppDirs::new("tilo-chat").data() is ~/.local/share/tilo-chat on Linux.
AppPaths
Where one app keeps its files, the same API on every target.
InvalidVPath
ProfileScope
Keeps a thread’s per-user folders below one root until it is dropped: see scope_profile.
VPath
A relative path inside a VirtualRoot or below a native location: /-separated components, none of them empty, . or ... The empty path is the root itself.

Enums§

Availability
Feature
Location
Where something lives. Native targets give paths; the web gives virtual roots, and so does a native process that has no home directory, whose storage then lasts only as long as the process.
UserDir
One of the user’s well-known content directories (Documents, Downloads, …).
VirtualRoot

Constants§

APPS_DATA_DIR_ENV
Names the device’s store of apps and the runtimes they run on instead of its default directory.
DEFAULT_PROFILE
The browser profile an app’s web storage belongs to unless the host chose another with set_default_profile, or a caller with AppPaths::with_profile.
TRUSTED_IDENTITIES
The file a Tilo Linux session writes the people and devices it certifies to: what an app showing who a file is shared with names them from.
WORKSPACE_MOUNT
Where a Tilo Linux session mounts the collaborative workspace, and the root every member’s documents name workspace files under, whatever this device mounts. AppPaths::workspace_root says whether (and where) this process has one mounted.
WORKSPACE_TREES_DIR
The directory, at the root of the device’s files, that holds one tree per workspace: <files>/.workspaces/<workspace id>. The device’s files are one namespace (fs serves one per device); a workspace’s own files are the tree under its id, so its access checks (FsPath grants, which scope by path prefix) cover each tree as they cover any folder.

Functions§

audio_dir
availability
available
cache_dir
The platform’s per-user cache directory: xdg::cache_home on Linux and other Unix, ~/Library/Caches on macOS, %LOCALAPPDATA% on Windows.
config_dir
The platform’s per-user configuration directory: xdg::config_home on Linux and other Unix, ~/Library/Application Support on macOS, %APPDATA% on Windows.
data_dir
The platform’s per-user data directory: xdg::data_home on Linux and other Unix, ~/Library/Application Support on macOS, %APPDATA% on Windows.
data_local_dir
The platform’s per-user local (non-roaming) data directory: xdg::data_home on Linux and other Unix, ~/Library/Application Support on macOS, %LOCALAPPDATA% on Windows.
default_profile
desktop_dir
device_data_dir
The device’s own store of apps and the runtimes they run on: APPS_DATA_DIR_ENV when it names an absolute path, else the platform data directory’s tilo-apps.
document_dir
download_dir
env_dir
$name as a directory, following the XDG rule for every base-directory variable: honoured only when set, non-empty and absolute.
home
The user’s home directory: $HOME when set and non-empty, the account database’s entry when $HOME is unset (on Unix), and None for an empty $HOME — an empty value names no directory, and resolving relative to the working directory would scatter state wherever the process started. On Windows it is the profile known folder, never an environment variable.
is_workspace_tree_id
language_of
The language a locale names, as a language pack is named: its language subtag, lower case (de of de, de-DE, de_DE.UTF-8@euro). One pack holds a language’s catalogues whatever region, encoding or modifier a locale adds, so a choice, the pack’s directory and its package id meet at this one name. Empty when no language is named.
language_packs_dir
locale_tag
The BCP 47 tag a locale names: the POSIX de_DE.UTF-8@euro, the LANGUAGE list de_AT:en_US and the BCP 47 de-DE all name de-DE. The encoding and the modifier name no language, a list’s first entry is the language, and a tag spells the _ a POSIX locale uses as -.
matching
The position in candidates (language tags, in the order the caller prefers them) of the one a reader of locale reads best: their own tag (de-DE for de_DE.UTF-8), else another region of their language (de-DE for de-AT). None when neither is there or locale names no language. This is the one rule for which tag a reader gets, so every catalogue, name and window picks the same one.
memory_temp_dir
A temporary directory kept in memory, where the platform has one (/dev/shm on Linux): for scratch data that is synced like a person’s but deleted moments later (a test’s profile), whose syncs then cost nothing instead of waiting on a shared disk. None elsewhere.
names_language
Whether tag names a language: C, POSIX, C.UTF-8 and an empty value name none, so their text is read untranslated.
picture_dir
profile_root
The per-user Tilo profile root: $XDG_CONFIG_HOME/tilo, else $HOME/.config/tilo on Linux and other Unix, the platform’s configuration directory elsewhere.
runtime_dir
The per-login runtime directory: xdg::runtime_dir on Linux and other Unix, the per-user $TMPDIR on macOS when it is absolute; Windows defines none.
runtime_publishers
The runtime publishers this device accepts, one hex Ed25519 key per line, # comments: the list the system ships beside the code that reads it. A Linux image ships it in /etc/tilo; on a Mac it is in the resources of the Tilo.app whose executable is running, sealed by the app’s signature as that executable is. An executable outside an app bundle reads the image’s path, which a Mac does not have, so it trusts no runtime.
scope_profile
From now until the guard drops, this thread’s home is root: home, the per-user base folders, env_dir of the XDG variables and AppPaths::for_app all resolve below it, whatever the process environment says, and no workspace is mounted. A host that runs a member (an agent) on its own thread gives it a profile apart from the host user’s this way. Threads the scoped thread starts do not inherit it.
scoped_profile
set_default_profile
Make profile the one AppPaths::for_app resolves web storage in, for the rest of the process (on the web, the page). A browser host calls this once, with the profile it mounts, before any app resolves its paths.
state_dir
The platform’s per-user state directory: xdg::state_home on Linux and other Unix, ~/Library/Application Support on macOS (which keeps state beside data), %LOCALAPPDATA% on Windows: state belongs to this computer, and what roams with the account (%APPDATA%) would carry it to others.
system_font_dirs
Directories the system and the user install fonts into, most general first, whether or not they exist: the system font trees on Linux and other Unix (not the user’s own), /System/Library/Fonts, /Library/Fonts and ~/Library/Fonts on macOS, the Windows font folder, and none on the web. For code that reads font files itself (a document renderer’s fallback fonts, a confined helper’s read grant).
temp_dir
The system’s shared temporary directory ($TMPDIR or /tmp, %TEMP%), and None where there is no native file system (the web), where std::env::temp_dir panics instead. For scratch files that must have a native path; an app’s own scratch space is AppPaths::runtime.
unscoped
var
The environment variable name, as this process’s profile scopes it: a location variable resolves below the profile root a test or a stack lent this process, and any other is read as the process has it.
video_dir
workspace_root
workspace_tree
The tree of the workspace id’s own files under the device’s files at files: WORKSPACE_TREES_DIR/<id>. None for an id that is not one path component of [A-Za-z0-9_-], 1 to 128 bytes, so no id names a directory outside its own tree.

Type Aliases§

Unsupported