fold-rs 0.1.0

Minimal, dependency-free resolver for standard base directories
Documentation
  • Coverage
  • 100%
    25 out of 25 items documented1 out of 21 items with examples
  • Size
  • Source code size: 33.45 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 659.64 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • seq-rs/fold-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • recrypted

Resolves standard platform base directories (config, data, cache, state, executable, user dirs, home) with zero dependencies.

By default each function follows the native conventions of the host OS. Enabling the xdg cargo feature forces XDG semantics on every platform.

Function families

  • Base dirs: [config], [data], [cache], [state], plus their app-scoped _for(qualifier, org, app) variants ([config_for], [data_for], [cache_for], [state_for]).
  • User dirs: [downloads], [desktop], [documents], [music], [pictures], [videos], [templates], [public], [projects].
  • [executable] and [home].

Return types

Functions for always-present directories return [Result], erroring only when HOME cannot be resolved. Functions whose directory may legitimately be absent return [Option].

Example

let cfg = folders::config_for("com", "example", "myapp")?;
# Ok::<(), folders::Error>(())