Expand description
Lifecycle-managed work directory.
WorkDir owns a directory and guarantees its existence for the
duration of the value’s lifetime.
§Motivation
Temporary directories require explicit lifecycle management: who creates, who owns, and who cleans up. Without a dedicated owner, temp directories leak on disk (no RAII guard) or use predictable names (security risk).
WorkDir centralises this concern so that callers never
interact with std::env::temp_dir() or tempfile::TempDir directly.
§Variants
| Variant | Created by | Drop behaviour |
|---|---|---|
Persistent | User-specified path | Directory is kept |
Temporary | Auto-generated | Directory is deleted |
Enums§
- WorkDir
- A directory whose existence is guaranteed while this value is alive.