codec_cbor/value.rs
1// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
2//
3// SPDX-License-Identifier: Apache-2.0
4
5/// A decoded DAG-CBOR value.
6#[derive(Debug, Clone, PartialEq)]
7#[non_exhaustive]
8pub enum CborValue {
9 /// CBOR null.
10 Null,
11 /// CBOR boolean.
12 Bool(bool),
13 /// A signed integer within the `i64` range.
14 Int(i64),
15 /// A UTF-8 text string.
16 String(String),
17 /// A byte string.
18 Bytes(Vec<u8>),
19 /// An array of values.
20 Array(Vec<CborValue>),
21 /// A map of text-string keys to values, in canonical key order.
22 Map(Vec<(String, CborValue)>),
23}