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
56
57
58
59
/// Format for CBOR decoding or encoding.
///
/// Selected on [`DecodeOptions`](crate::DecodeOptions) to choose how
/// input bytes are interpreted. All three formats decode to the same
/// [`Value`](crate::Value) type.
///
/// | Variant | Description |
/// |---|---|
/// | [`Binary`](Self::Binary) | Standard CBOR binary encoding (RFC 8949). |
/// | [`Hex`](Self::Hex) | Hex-encoded CBOR binary: each CBOR byte as two ASCII hex digits. |
/// | [`Diagnostic`](Self::Diagnostic) | CBOR diagnostic notation (Section 8 of RFC 8949, Section 2.3.6 of CBOR::Core). |
/// Format for CBOR output produced by [`SequenceWriter`](crate::SequenceWriter).
///
/// Mirrors [`Format`] on the encode side, but adds output-only variants
/// the decoder has no use for.
///
/// | Variant | Output |
/// |---|---|
/// | [`Binary`](Self::Binary) | Standard CBOR binary encoding. |
/// | [`Hex`](Self::Hex) | Hex-encoded CBOR binary, lowercase. |
/// | [`Diagnostic`](Self::Diagnostic) | Compact diagnostic notation. Sequence items are separated by `, `. |
/// | [`DiagnosticPretty`](Self::DiagnosticPretty) | Pretty-printed diagnostic notation (`{:#?}`-style, indented). Sequence items are separated by `,\n`. |
///
/// `From<Format> for EncodeFormat` lets any [`Format`] pass through an
/// `impl Into<EncodeFormat>` bound unchanged.