mirror of
https://github.com/openharmony/third_party_rust_tracing.git
synced 2026-06-30 21:27:56 -04:00
serde: implement AsSerde for FieldSet (#2241)
## Motivation I've wanted to serialize fieldset of current span. ## Solution Expose already existing `SerializeFieldSet` for users by implementing `AsSerde` for `FieldSet`.
This commit is contained in:
committed by
Eliza Weisman
parent
55d339bbc9
commit
1e7fa03a34
@@ -565,6 +565,14 @@ impl<'a> AsSerde<'a> for Level {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> AsSerde<'a> for FieldSet {
|
||||
type Serializable = SerializeFieldSet<'a>;
|
||||
|
||||
fn as_serde(&'a self) -> Self::Serializable {
|
||||
SerializeFieldSet(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> self::sealed::Sealed for Event<'a> {}
|
||||
|
||||
impl<'a> self::sealed::Sealed for Attributes<'a> {}
|
||||
@@ -577,6 +585,8 @@ impl<'a> self::sealed::Sealed for Record<'a> {}
|
||||
|
||||
impl<'a> self::sealed::Sealed for Metadata<'a> {}
|
||||
|
||||
impl self::sealed::Sealed for FieldSet {}
|
||||
|
||||
mod sealed {
|
||||
pub trait Sealed {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user