Skip to main content

Module work_dir

Module work_dir 

Source
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

VariantCreated byDrop behaviour
PersistentUser-specified pathDirectory is kept
TemporaryAuto-generatedDirectory is deleted

Enums§

WorkDir
A directory whose existence is guaranteed while this value is alive.