Skip to main content

Module paths

Module paths 

Source
Expand description

XDG-aware filesystem paths for LinkMarks.

All defaults follow the XDG Base Directory specification:

  • Data: ${XDG_DATA_HOME:-~/.local/share}/linkmarks/
  • Config: ${XDG_CONFIG_HOME:-~/.config}/linkmarks/

On macOS / Windows the dirs crate falls back to ~/Library/Application Support/linkmarks and %APPDATA%\linkmarks respectively. The CLI exposes --data-dir, --store, and --config flags to override these defaults at runtime.

Constants§

APP_DIR
Application name used as the XDG leaf directory.
CONFIG_FILENAME
Config filename inside the config directory.
STORE_FILENAME
Store filename inside the data directory.

Functions§

default_config_dir_display
Convenience helper: returns the default config directory as String for error messages; returns the literal string when the path cannot be represented.
default_data_dir_display
Convenience helper: returns the default config directory as &str for error messages; returns the literal string when the path cannot be represented.
ensure_config_dir
Create the config directory (and parents) if it does not exist.
ensure_data_dir
Create the data directory (and parents) if it does not exist.
is_inside_data_dir
Returns whether the path lives under the configured data directory.
linkmarks_config_dir
Returns the config directory (${XDG_CONFIG_HOME:-~/.config}/linkmarks).
linkmarks_config_path
Returns the default config file path (<config_dir>/config.toml).
linkmarks_data_dir
Returns the data directory (${XDG_DATA_HOME:-~/.local/share}/linkmarks).
linkmarks_store_path
Returns the default SQLite store path (<data_dir>/store.db).