Skip to main content

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)]
7pub enum CborValue {
8    /// CBOR null.
9    Null,
10    /// CBOR boolean.
11    Bool(bool),
12    /// A signed integer within the `i64` range.
13    Int(i64),
14    /// A UTF-8 text string.
15    String(String),
16    /// A byte string.
17    Bytes(Vec<u8>),
18    /// An array of values.
19    Array(Vec<CborValue>),
20    /// A map of text-string keys to values, in canonical key order.
21    Map(Vec<(String, CborValue)>),
22}