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
60
61
62
63
64
65
66
67
68
// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0
//! # Encoder layout & naming convention
//!
//! ```text
//! msgpack_encoder/
//! ├── v04/
//! │ ├── mod.rs // public API + payload-level helpers
//! │ ├── span_v04.rs // v0.4 in-memory Span → v0.4 wire (native)
//! │ └── span_v1.rs // v1 in-memory Span → v0.4 wire (downgrade)
//! └── v1/
//! ├── mod.rs
//! ├── span_v04.rs // v0.4 in-memory Span → V1 wire (upgrade)
//! └── span_v1.rs // v1 in-memory Span → V1 wire (native)
//! ```
//!
//! - **Module (`v04`/`v1`) = output wire format.**
//! - **File suffix (`_v04`/`_v1`) = input span type.**
//! - **Public functions carry a `_from_<input>` suffix**, so a caller reads the *output* from the
//! module path and the *input* from the function name:
//!
//! | Module | Function | Input → Output |
//! |--------|----------|----------------|
//! | `v04::` | `to_vec_from_v04`, `write_to_slice_from_v04`, `to_encoded_byte_len_from_v04` | v04 → v0.4 (native) |
//! | `v04::` | `to_vec_from_v1`, `write_to_slice_from_v1`, `to_encoded_byte_len_from_v1` | v1 → v0.4 (downgrade) |
//! | `v1::` | `to_vec_from_v04`, `write_to_slice_from_v04`, `to_encoded_byte_len_from_v04` | v04 → V1 (upgrade) |
//! | `v1::` | `to_vec_from_v1`, `write_to_slice_from_v1`, `to_encoded_byte_len_from_v1` | v1 → V1 (native) |
use ValueWriteError;
use Infallible;
/// Flatten `ValueWriteError<Infallible>` (uninhabited because both variants wrap
/// `Infallible`) into the bare `Infallible` so callers can use
/// [`libdd_common::ResultInfallibleExt`].
pub
/// A writer that counts bytes without storing them, used to compute encoded payload size.
pub ;