Skip to main content

Crate dotstore

Crate dotstore 

Source
Expand description

Library to create dot directories in common system places.

It’s essentially a wrapper around the dirs crate that allows you to create dot directories (e.g. /home/user/.project-name) in common places (e.g. Home dir, Config dir etc.) to store program data and configs.

You can also create them in custom locations

§Examples

use dotstore;

fn main() -> std::io::Result<()> {
    // Create a new directory called `/home/user/.barracuda`
    // The `.` is automatically appended
    let project_dir = dotstore::home_store("barracuda")?;

    // Create a new directory called `/home/user/.config/.editor`
    let editor_dir = dotstore::config_store("editor")?;

    // Create a new directory called `/home/user/workspace/middle-earth/.eregion`
    let custom_dir = dotstore::custom_store("/home/user/workspace/middle-earth", "eregion")?;

    Ok(())
}

Functions§

audio_store
Creates a new dot directory in the systems Audio path (See dirs::audio_dir)
cache_store
Creates a new dot directory in the systems Cache path (See dirs::cache_dir)
config_store
Creates a new dot directory in the systems Config path (See dirs::config_dir)
custom_store
Create a new dot directory in a custom location of your choosing.
data_store
Creates a new dot directory in the systems Data path (See dirs::data_dir)
desktop_store
Creates a new dot directory in the systems Desktop path (See dirs::desktop_dir)
document_store
Creates a new dot directory in the systems Document path (See dirs::document_dir)
download_store
Creates a new dot directory in the systems Download path (See dirs::download_dir)
executable_store
Creates a new dot directory in the systems Executable path (See dirs::executable_dir)
font_store
Creates a new dot directory in the systems Font path (See dirs::font_dir)
home_store
Creates a new dot directory in the systems Home path (See dirs::home_dir)
local_config_store
Creates a new dot directory in the systems local Config path (See dirs::config_local_dir)
local_data_store
Creates a new dot directory in the systems local Data path (See dirs::data_local_dir)
picture_store
Creates a new dot directory in the systems Picture path (See dirs::picture_dir)
preference_store
Creates a new dot directory in the systems Preference path (See dirs::picture_dir)
public_store
Creates a new dot directory in the systems Public path (See dirs::public_dir)
runtime_store
Creates a new dot directory in the systems Runtime path (See dirs::runtime_dir)
state_store
Creates a new dot directory in the systems State path (See dirs::runtime_dir)
template_store
Creates a new dot directory in the systems Template path (See dirs::template_dir)
video_store
Creates a new dot directory in the systems Video path (See dirs::video_dir)