Skip to main content

qubit_fs/directory/
directory_stream_state.rs

1// =============================================================================
2//    Copyright (c) 2025 - 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Directory stream lifecycle states.
9
10/// Lifecycle state of a directory enumeration handle.
11///
12/// # Examples
13///
14/// ```rust
15/// use qubit_fs::directory::DirectoryStreamState;
16///
17/// assert!(matches!(DirectoryStreamState::Open, DirectoryStreamState::Open));
18/// ```
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20#[must_use]
21pub enum DirectoryStreamState {
22    /// The stream may still produce entries.
23    Open,
24    /// The provider reported the end of enumeration.
25    Exhausted,
26    /// Enumeration stopped because validation or provider I/O failed.
27    Failed,
28}