Skip to main content

qubit_json/value/traverse/
json_tree_control.rs

1// =============================================================================
2//    Copyright (c) 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Defines ordinary JSON tree traversal control.
9
10/// Selects whether a successfully visited node exposes its descendants.
11///
12/// # Examples
13///
14/// ```
15/// use qubit_json::value::traverse::JsonTreeControl;
16///
17/// let control = JsonTreeControl::SkipSubtree;
18/// assert_eq!(control, JsonTreeControl::SkipSubtree);
19/// ```
20#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
21pub enum JsonTreeControl {
22    /// Visit the node's descendants in normal depth-first order.
23    Descend,
24    /// Do not visit or charge the node's descendants.
25    SkipSubtree,
26}