Skip to main content

qubit_fs/temp/
temp_dir_options.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Temporary directory creation options.
11
12use crate::FsPath;
13
14/// Options controlling temporary directory creation.
15#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct TempDirOptions {
17    /// Parent directory or prefix for the temporary directory.
18    pub parent: Option<FsPath>,
19    /// Name prefix.
20    pub prefix: String,
21    /// Name suffix.
22    pub suffix: String,
23}
24
25impl Default for TempDirOptions {
26    #[inline]
27    fn default() -> Self {
28        Self {
29            parent: None,
30            prefix: ".tmp-dir-".to_owned(),
31            suffix: String::new(),
32        }
33    }
34}