Skip to content

Key-value serializer adapters - #426

Merged
KodrAus merged 2 commits into
rust-lang:masterfrom
KodrAus:feat/kv-downcast
Dec 21, 2020
Merged

Key-value serializer adapters#426
KodrAus merged 2 commits into
rust-lang:masterfrom
KodrAus:feat/kv-downcast

Conversation

@KodrAus

Copy link
Copy Markdown
Contributor

This PR does two things:

This means Log implementors can now write something like:

use log::kv::source;#[derive(Serialize)]pubstructMyRecordAsMap<'a>{msg:&'astr,#[serde(flatten)]#[serde(with = "source::as_map")]kvs:&'adynSource,}

to define a type that can be serialized using serde as a map with key values flattened.

@KodrAus
KodrAus merged commit c4ed87c into rust-lang:masterDec 21, 2020
@KodrAus
KodrAus deleted the feat/kv-downcast branch December 21, 2020 05:32
@passcod

Copy link
Copy Markdown

Would be nice to add that code sample to the kv docs as it's not super obvious how to use it otherwise

EFanZh pushed a commit to EFanZh/log that referenced this pull request Jul 23, 2023
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.35 to 1.0.36.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@1.0.35...1.0.36)
---
updated-dependencies:
- dependency-name: thiserror
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@KodrAus@passcod