Document hammond-data/src/lib.rs xdg_dirs module.
This commit is contained in:
parent
76f9f36609
commit
7dd8755bcb
@ -1,4 +1,5 @@
|
|||||||
#![recursion_limit = "1024"]
|
#![recursion_limit = "1024"]
|
||||||
|
#![warn(missing_docs)]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))]
|
#![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
@ -25,9 +26,11 @@ extern crate rss;
|
|||||||
extern crate url;
|
extern crate url;
|
||||||
extern crate xdg;
|
extern crate xdg;
|
||||||
|
|
||||||
|
#[allow(missing_docs)]
|
||||||
pub mod dbqueries;
|
pub mod dbqueries;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod feed;
|
pub mod feed;
|
||||||
|
#[allow(missing_docs)]
|
||||||
pub mod errors;
|
pub mod errors;
|
||||||
pub(crate) mod database;
|
pub(crate) mod database;
|
||||||
pub(crate) mod models;
|
pub(crate) mod models;
|
||||||
@ -36,27 +39,32 @@ mod schema;
|
|||||||
|
|
||||||
pub use models::queryables::{Episode, Podcast, Source};
|
pub use models::queryables::{Episode, Podcast, Source};
|
||||||
|
|
||||||
|
/// [XDG Base Direcotory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) Paths.
|
||||||
pub mod xdg_dirs {
|
pub mod xdg_dirs {
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use xdg;
|
use xdg;
|
||||||
|
|
||||||
lazy_static!{
|
lazy_static!{
|
||||||
pub static ref HAMMOND_XDG: xdg::BaseDirectories = {
|
pub(crate) static ref HAMMOND_XDG: xdg::BaseDirectories = {
|
||||||
xdg::BaseDirectories::with_prefix("hammond").unwrap()
|
xdg::BaseDirectories::with_prefix("hammond").unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// XDG_DATA Directory `Pathbuf`.
|
||||||
pub static ref HAMMOND_DATA: PathBuf = {
|
pub static ref HAMMOND_DATA: PathBuf = {
|
||||||
HAMMOND_XDG.create_data_directory(HAMMOND_XDG.get_data_home()).unwrap()
|
HAMMOND_XDG.create_data_directory(HAMMOND_XDG.get_data_home()).unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// XDG_CONFIG Directory `Pathbuf`.
|
||||||
pub static ref HAMMOND_CONFIG: PathBuf = {
|
pub static ref HAMMOND_CONFIG: PathBuf = {
|
||||||
HAMMOND_XDG.create_config_directory(HAMMOND_XDG.get_config_home()).unwrap()
|
HAMMOND_XDG.create_config_directory(HAMMOND_XDG.get_config_home()).unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// XDG_CACHE Directory `Pathbuf`.
|
||||||
pub static ref HAMMOND_CACHE: PathBuf = {
|
pub static ref HAMMOND_CACHE: PathBuf = {
|
||||||
HAMMOND_XDG.create_cache_directory(HAMMOND_XDG.get_cache_home()).unwrap()
|
HAMMOND_XDG.create_cache_directory(HAMMOND_XDG.get_cache_home()).unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Hammond Download Direcotry `PathBuf`.
|
||||||
pub static ref DL_DIR: PathBuf = {
|
pub static ref DL_DIR: PathBuf = {
|
||||||
HAMMOND_XDG.create_data_directory("Downloads").unwrap()
|
HAMMOND_XDG.create_data_directory("Downloads").unwrap()
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user