Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kodraus/serde_fmt
A serde Serializer for the standard formatting machinery
https://github.com/kodraus/serde_fmt
rust serde
Last synced: about 2 months ago
JSON representation
A serde Serializer for the standard formatting machinery
- Host: GitHub
- URL: https://github.com/kodraus/serde_fmt
- Owner: KodrAus
- License: apache-2.0
- Created: 2019-05-01T06:28:12.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T00:26:47.000Z (over 1 year ago)
- Last Synced: 2024-04-25T11:20:42.245Z (9 months ago)
- Topics: rust, serde
- Language: Rust
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# `serde_fmt`
[![rust](https://github.com/KodrAus/serde_fmt/actions/workflows/rust.yml/badge.svg)](https://github.com/KodrAus/serde_fmt/actions/workflows/rust.yml)
[![Latest version](https://img.shields.io/crates/v/serde_fmt.svg)](https://crates.io/crates/serde_fmt)
[![Documentation Latest](https://docs.rs/serde_fmt/badge.svg)](https://docs.rs/serde_fmt)Convert any `serde::Serialize` into a `std::fmt::Debug`:
```rust
fn takes_serialize(v: impl Serialize) {
dbg!(serde_fmt::to_debug(&v));// Do something with `v`
}
```## Supported `rustc`
This library requires a Rust compiler that's at least `1.42.0`.
## Getting started
Add `serde_fmt` to your `Cargo.toml`:
```toml
[dependencies.serde_fmt]
version = "1.0.3"
```By default, this library will depend on the standard library. To use it in no-std environments, you can disable the default crate features:
```toml
[dependencies.serde_fmt]
version = "1.0.3"
default-features = false
```