get_server_config_file_path

Function get_server_config_file_path 

Source
pub fn get_server_config_file_path() -> Result<PathBuf, MantaError>
Expand description

Returns the server config file path, honoring MANTA_SERVER_CONFIG if set.

Symmetric to get_cli_config_file_path: env-var wins verbatim, otherwise XDG default (~/.config/manta/server.toml on Linux).

§Errors

Returns MantaError::MissingField if MANTA_SERVER_CONFIG is unset and the platform cannot resolve a project-dirs triple.

§Examples

use manta_shared::common::config::get_server_config_file_path;

// SAFETY: doc-tests run single-threaded.
unsafe { std::env::set_var("MANTA_SERVER_CONFIG", "/etc/manta/server.toml") };
let path = get_server_config_file_path().unwrap();
assert_eq!(path, std::path::PathBuf::from("/etc/manta/server.toml"));