1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright Peter G. Bower 2025-2026.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! # Codec decoder contract
//!
//! Implemented BY format codecs (types in `models/codecs/` and
//! related decoders) that consume bytes and return a reconstructed
//! value of the codec's output type.
//!
//! Codecs may be stateful when the format requires continuity
//! (accumulated schema and dictionary state for Arrow IPC, for
//! example), so methods take `&mut self`. For one-shot use - which
//! is what [`crate::traits::serialise::Serialise`] uses - the impl
//! is expected to fully reconstruct the value from a self-contained
//! byte buffer against a freshly constructed codec.
//!
//! This contract is distinct from
//! [`crate::traits::frame_decoder::FrameDecoder`], which operates at
//! the wire-frame layer for the streaming readers.
use Vec64;
/// One-shot decoder: takes a self-contained byte buffer, returns the
/// reconstructed value.
///
/// `decode` is the required method. `decode_owned` is an optional
/// zero-copy override that takes ownership of an aligned `Vec64<u8>`
/// and can feed it to the underlying parser without a memcpy; the
/// default forwards to `decode`.