qubit_codec/codec.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//! Bidirectional codec trait.
11
12use crate::{
13 Decoder,
14 Encoder,
15};
16
17/// Combines an [`Encoder`] and a [`Decoder`] into a bidirectional codec.
18pub trait Codec<EncodeInput: ?Sized, DecodeInput: ?Sized>:
19 Encoder<EncodeInput> + Decoder<DecodeInput>
20{
21}
22
23impl<T, EncodeInput: ?Sized, DecodeInput: ?Sized> Codec<EncodeInput, DecodeInput> for T where
24 T: Encoder<EncodeInput> + Decoder<DecodeInput>
25{
26}