1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// =============================================================================
// Copyright (c) 2025 - 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Borrowed scalar collection item.
/// A borrowed scalar item together with its index in the original source.
///
/// The value may be trimmed according to
/// [`crate::CollectionConversionPolicy`], while the index always identifies
/// the raw item before empty-item filtering.
///
/// # Type Parameters
///
/// * `'a` - Lifetime of the borrowed item text.
///
/// # Examples
///
/// ```
/// # #[cfg(feature = "converter")]
/// # {
/// use qubit_datatype::ScalarItem;
///
/// let item = ScalarItem {
/// source_index: 2,
/// value: " 42 ",
/// };
/// assert_eq!(item.source_index, 2);
/// assert_eq!(item.value, " 42 ");
/// # }
/// ```