Skip to main content

qubit_codec/buffered/
buffered_decoder.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Semantic marker trait for buffered decoders.
11
12use super::BufferedTranscoder;
13
14/// Decodes encoded units into logical values over caller-provided buffers.
15///
16/// `BufferedDecoder` refines [`BufferedTranscoder`] for implementations whose input is
17/// the encoded unit stream and whose output is the logical value stream. The
18/// trait adds no methods; it exists to make generic bounds distinguish decoding
19/// direction from encoding and unit-to-unit conversion.
20///
21/// The word "buffered" describes the caller-managed buffer and progress model.
22/// It does not require the implementor to own an internal buffer.
23///
24/// # Type Parameters
25///
26/// - `Unit`: Encoded unit type accepted by the decoder.
27/// - `Value`: Logical value type produced by the decoder.
28pub trait BufferedDecoder<Unit, Value>: BufferedTranscoder<Unit, Value> {}