musli_core::en

Trait EncodeTrace

Source
pub trait EncodeTrace<M> {
    // Required method
    fn trace_encode<E>(&self, cx: &E::Cx, encoder: E) -> Result<E::Ok, E::Error>
       where E: Encoder<Mode = M>;
}
Expand description

Trait governing how types are encoded 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_encode<E>(&self, cx: &E::Cx, encoder: E) -> Result<E::Ok, E::Error>
where E: Encoder<Mode = M>,

Encode the given output.

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, M, K, V> EncodeTrace<M> for BTreeMap<K, V>
where K: Display + Encode<M>, V: Encode<M>,

Source§

fn trace_encode<E>(&self, _cx: &E::Cx, encoder: E) -> Result<E::Ok, E::Error>
where E: Encoder<Mode = M>,

Source§

impl<'de, M, K, V, S> EncodeTrace<M> for HashMap<K, V, S>
where K: Display + Encode<M>, V: Encode<M>, S: BuildHasher + Default,

Source§

fn trace_encode<E>(&self, _cx: &E::Cx, encoder: E) -> Result<E::Ok, E::Error>
where E: Encoder<Mode = M>,

Implementors§