anydir
A Rust library that provides a unified interface for working with both compile-time embedded directories and runtime directories.
Motivation
It frustrated me that no Rust library had an abstracted Dir type that allowed for both embedded compile-time directories and runtime directories, so I made one.
If you know of such a library, please let me know !
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
use anydir;
Features
- Compile-time embedding: Bundle directory contents directly in your binary
- Runtime access: Load directories from the filesystem at runtime
- Unified API: Work with both types using the same interface
- Zero-cost abstraction: No runtime overhead for compile-time directories
- Simple macros: Easy-to-use macro interface
API
Macros
anydir!(ct, path)- Create a compile-time embedded directoryanydir!(rt, path)- Create a runtime directory reference
Traits
DirOps- Common operations for directorieslist_files()- Returns a vector of filenames in the directory