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
50
51
52
53
54
55
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! CBOR encoding/decoding abstraction layer.
//!
//! Provides a [`CborCodec`] trait for deterministic CBOR encoding/decoding,
//! plus a backend-agnostic [`value::Value`] enum and [`value::Tagged`] wrapper.
//!
//! The default (and currently only) backend is the in-house minimal CBOR
//! implementation in [`minimal`], which guarantees RFC 8949 §4.2.1
//! deterministic encoding with zero external dependencies.
//!
//! The [`CborCodec`] trait is designed so that alternative backends (e.g.,
//! ciborium) can be added behind feature gates in the future without
//! changing any type definitions or public APIs.
use crate*;
use crate;
use ;
/// Trait abstracting CBOR encode/decode operations.
///
/// Only deterministic encoding is provided. Map keys are emitted in ascending
/// integer order by the `CborSerialize` derive macro, satisfying RFC 8949
/// §4.2.1 (CBOR Core Deterministic Encoding).
///
/// This trait exists so that alternative CBOR backends can be plugged in
/// behind feature gates without changing the rest of the crate.
/// The active CBOR codec.
pub type DefaultCodec = MinimalCodec;
/// Convenience: encode using the default codec.
/// Convenience: decode using the default codec.