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
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Shared codec error type.
use NonZeroUsize;
use DecodeFailure;
pub use MiscCodecError;
/// Result alias returned by codec operations.
///
/// # Type Parameters
///
/// - `T`: Value produced by a successful codec operation.
pub type MiscCodecResult<T> = ;
/// Maps a malformed value to a decode failure with a known input width.
///
/// # Parameters
///
/// - `error`: Codec-specific error describing the malformed value.
/// - `consumed`: Non-zero number of input units consumed by the malformed
/// value.
///
/// # Returns
///
/// Returns an invalid decode failure that retains `error` and records
/// `consumed` as the input width.
pub