qubit_codec/transcode/transcode_decoder.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//! Semantic marker trait for buffered decoders.
9
10use super::{
11 TranscodeDecodeError,
12 Transcoder,
13};
14
15/// Decodes encoded units into logical values over caller-provided buffers.
16///
17/// `TranscodeDecoder` refines [`Transcoder`] for implementations whose
18/// input is the encoded unit stream and whose output is the logical value
19/// stream. The trait adds no methods; it exists to make generic bounds
20/// distinguish decoding direction from encoding and unit-to-unit conversion.
21///
22/// The word "buffered" describes the caller-managed buffer and progress model.
23/// It does not require the implementor to own an internal buffer.
24pub trait TranscodeDecoder:
25 Transcoder<Error = TranscodeDecodeError<Self::DecodeError>>
26{
27 /// Domain error type produced by decode internals.
28 type DecodeError;
29}