musli_core/de/
decode_trace.rs

1use crate::Allocator;
2
3use super::Decoder;
4
5/// Trait governing how types are decoded specifically for tracing.
6///
7/// This is used for types where some extra bounds might be necessary to trace a
8/// container such as a [`HashMap<K, V>`] where `K` would have to implement
9/// [`fmt::Display`].
10///
11/// [`HashMap<K, V>`]: std::collections::HashMap
12/// [`fmt::Display`]: std::fmt::Display
13pub trait DecodeTrace<'de, M, A>: Sized
14where
15    A: Allocator,
16{
17    /// Decode the given input.
18    fn trace_decode<D>(decoder: D) -> Result<Self, D::Error>
19    where
20        D: Decoder<'de, Mode = M, Allocator = A>;
21}