serde_fmt
Convert any serde::Serialize
into a std::fmt::Debug
:
fn takes_serialize(v: impl Serialize) {
dbg!(serde_fmt::to_debug(&v));
// Do something with `v`
}
Supported rustc
This library requires a very recent nightly compiler.
Getting started
Add serde_fmt
to your Cargo.toml
:
[dependencies.serde_fmt]
version = "0.1.0"
By default, this library will depend on the standard library. To use it it no-std environments, you can disable the default crate features:
[dependencies.serde_fmt]
version = "0.1.0"
default-features = false