1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use PathBuf;
pub const HTTP_HEADER_OLLANA_DEVICE_ID: &str = "X-Ollana-Device-Id";
/// Returns the path to the local data directory used by Ollana.
///
/// This method attempts to determine the location of the application's local data directory using
/// the `dirs` crate. If successful, it returns a `PathBuf` pointing to a subdirectory named
/// "ollana" within this directory.
///
/// # Returns
/// A `Result<PathBuf>` indicating success or failure:
/// - Ok(PathBuf): The path to the local data directory for Ollana.
/// - Err(anyhow::Error): An error if the local data directory cannot be determined.
///
/// # Errors
/// This function can return an `anyhow::Error` if it fails to determine the data local directory.
///