musli_core::de

Trait DecodeTrace

Source
pub trait DecodeTrace<'de, M>: Sized {
    // Required method
    fn trace_decode<D>(cx: &D::Cx, decoder: D) -> Result<Self, D::Error>
       where D: Decoder<'de, Mode = M>;
}
Expand description

Trait governing how types are decoded specifically for tracing.

This is used for types where some extra bounds might be necessary to trace a container such as a HashMap<K, V> where K would have to implement fmt::Display.

Required Methods§

Source

fn trace_decode<D>(cx: &D::Cx, decoder: D) -> Result<Self, D::Error>
where D: Decoder<'de, Mode = M>,

Decode the given input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'de, K, V, M> DecodeTrace<'de, M> for BTreeMap<K, V>
where K: Display + Decode<'de, M> + Ord, V: Decode<'de, M>,

Source§

fn trace_decode<D>(_cx: &D::Cx, decoder: D) -> Result<Self, D::Error>
where D: Decoder<'de, Mode = M>,

Source§

impl<'de, K, V, M, S> DecodeTrace<'de, M> for HashMap<K, V, S>
where K: Display + Decode<'de, M> + Eq + Hash, V: Decode<'de, M>, S: BuildHasher + Default,

Source§

fn trace_decode<D>(_cx: &D::Cx, decoder: D) -> Result<Self, D::Error>
where D: Decoder<'de, Mode = M>,

Implementors§