qubit-value 0.13.0

Type-safe containers for single, multi-valued, and named runtime values
Documentation
// =============================================================================
//    Copyright (c) 2025 - 2026 Haixing Hu.
//
//    SPDX-License-Identifier: Apache-2.0
//
//    Licensed under the Apache License, Version 2.0.
// =============================================================================

//! Borrowed wire representation for one named scalar value.

use serde::Serialize;

use crate::ValueWireRefV1;

/// Borrows a named scalar value for serialization without cloning its data.
///
/// The name and independently versioned scalar payload remain borrowed for
/// `'a`, the lifetime of the source [`super::super::NamedValue`].
///
/// # Type Parameters
///
/// * `'a` - Lifetime of the borrowed name and scalar payload.
#[derive(Serialize)]
pub(in crate::named_value) struct NamedValueWireRef<'a> {
    /// Name associated with the scalar value.
    pub(in crate::named_value) name: &'a str,
    /// Independently versioned scalar value.
    pub(in crate::named_value) value: ValueWireRefV1<'a>,
}