From 9bc2de32006359e433171cbd4a09a7e92696e4fa Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Tue, 23 Jul 2019 01:21:42 -0700 Subject: [PATCH] Mention that supporting types for event impl `Deserialize`. --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7a811702..91f89403 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,7 +75,8 @@ //! All concrete event types in ruma-events can be serialized via the `Serialize` trait from //! [serde](https://serde.rs/) and can be deserialized from a `&str` of JSON data via the `FromStr` //! trait from the standard library. (`TryFrom<&str>` is also implemented and can be used in place -//! of `FromStr` if preferred.) In order to handle incoming data that may not conform to +//! of `FromStr` if preferred.) Supporting types for each event generally implement serde's +//! `Deserialize` trait directly. In order to handle incoming data that may not conform to //! ruma-events's strict definitions of event structures, deserializing from JSON will return an //! `InvalidEvent` on error. This error covers both invalid JSON data as well as valid JSON that //! doesn't match the structure expected by ruma-events's event types. In the latter case, the error