Skip to main content

Module state

Module state 

Source
Expand description

The state file (REQ-08): UI choices kept between runs. Keys are namespaced <dashboard>.<name>, such as board.layout. Values are strings; structured values are JSON text.

Structs§

State

Functions§

directory_name
The Subspace data directory name of this build’s channel: subspace on stable, subspace-<type> for a pre-release type. Config, state and caches that are not product-specific use it.
path
<directory>/state.json in the platform state directory: $XDG_STATE_HOME on Linux, the local data directory elsewhere (Application Support on macOS, %LOCALAPPDATA% on Windows). directory_name gives the directory.
sibling
name beside the state file, such as github-cache.json. Large caches live in files of their own, so state.json stays small.
write_atomic
Writes text to file atomically: a temporary file in the same directory, then a rename over the old file.