Skip to main content

qubit_codec/transcode/
transcode_encoder.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 encoders.
9
10use super::Transcoder;
11
12/// Encodes logical values into encoded units over caller-provided buffers.
13///
14/// `TranscodeEncoder` refines [`Transcoder`] for implementations whose
15/// input is the logical value stream and whose output is the encoded unit
16/// stream. The trait adds no methods; it exists to make generic bounds
17/// distinguish encoding direction from decoding and unit-to-unit conversion.
18///
19/// The word "buffered" describes the caller-managed buffer and progress model.
20/// It does not require the implementor to own an internal buffer.
21///
22/// # Type Parameters
23///
24/// - `Value`: Logical value type accepted by the encoder.
25/// - `Unit`: Encoded unit type produced by the encoder.
26pub trait TranscodeEncoder<Value, Unit>: Transcoder<Value, Unit> {
27    // empty
28}