From 690f19b5d0cae2a371c3e9c415b626e23154a217 Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Fri, 18 Oct 2024 15:26:52 +0200 Subject: [PATCH] update(docs): mention serde support Signed-off-by: Grzegorz Nosek --- falco_event/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/falco_event/README.md b/falco_event/README.md index c6a43b2a..7765e504 100644 --- a/falco_event/README.md +++ b/falco_event/README.md @@ -128,3 +128,16 @@ you're not interested in. There is a trait ([events::EventToBytes]) that writes a serialized form of an event to a writer (i.e. a type that implements [std::io::Write], for example `Vec`). + +## Serialization and deserialization with [`serde`] + +Once you enable the `serde` feature of this crate, the following types gain serialization and deserialization +support: + +* all the `PT_*` field types (many are Rust stdlib built-ins and support (de)serialization regardless) +* all the [`event::types`] events (see the module documentation for details regarding owned/borrowed types) +* `Event` (but *not* other `Event` types, to avoid ambiguous serialization results and subsequent + deserialization issues) + +**Note**: you can serialize an event wrapping either the [borrowed](`event::types::AnyEvent`) or +[owned](`event::types::owned::AnyEvent`) variant of `AnyEvent`, but can only deserialize to the owned variant. \ No newline at end of file