Skip to content

Tracking Issue for xdg_basedir #157515

@CAD97

Description

@CAD97

Feature gate: #![feature(xdg_basedir)]

This is a tracking issue for API providing the XDG Base Directories in std::os::unix::xdg.

This is placed in os::unix because it is fundamentally intended to be an OS-specific API surface. Any portable directory conventions are necessarily restricted to only utilizing some widely available subset of conventions or porting one target's conventions to others' environments. This API is exposed such that programs have the option of specializing to the lower level platform-specific conventions.

Public API

// in std::os::unix::xdg (new module)

pub fn data_home_dir() -> PathBuf;
pub fn config_home_dir() -> PathBuf;
pub fn state_home_dir() -> PathBuf;
pub fn cache_home_dir() -> PathBuf;

#[derive(Debug, Clone)]
pub struct XdgDirsIter { /* ... */ };
impl Iterator for XdgDirsIter { /* ... */ }

pub fn data_dirs() -> XdgDirsIter;
pub fn config_dirs() -> XdgDirsIter;

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • Should we provide runtime_dir (doesn't have a specified default) and/or bin_home_dir (has a specified default but the environment variable override is a common non-XDG-standard extension)?

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-api-nominatedNominated for discussion during a libs-api team meeting.S-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions