Skip to main content

qubit_fs/options/
create_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//! Directory creation options.
11
12use qubit_metadata::Metadata;
13
14/// Options controlling directory or collection creation.
15#[derive(Clone, Debug, PartialEq)]
16pub struct CreateDirOptions {
17    /// Whether missing parent directories should be created.
18    pub recursive: bool,
19    /// Whether an existing directory should be accepted.
20    pub exists_ok: bool,
21    /// User-defined metadata to attach when supported.
22    pub user_metadata: Metadata,
23}
24
25impl Default for CreateDirOptions {
26    #[inline]
27    fn default() -> Self {
28        Self {
29            recursive: false,
30            exists_ok: false,
31            user_metadata: Metadata::new(),
32        }
33    }
34}