Skip to main content

qubit_json/decode/
json_path_segment.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//! Typed location within a JSON document.
9
10/// Identifies an object key or array index in a JSON value path.
11#[non_exhaustive]
12#[derive(Debug, Clone, PartialEq, Eq, Hash)]
13pub enum JsonPathSegment {
14    /// An object key after JSON escape decoding.
15    Key(String),
16    /// An array element index.
17    Index(usize),
18}