serde: Improve docs for Raw<T>

This commit is contained in:
Kévin Commaille 2024-09-07 16:43:26 +02:00 committed by Kévin Commaille
parent a56787e506
commit 9203934fd7

View File

@ -11,10 +11,7 @@ use serde::{
}; };
use serde_json::value::{to_raw_value as to_raw_json_value, RawValue as RawJsonValue}; use serde_json::value::{to_raw_value as to_raw_json_value, RawValue as RawJsonValue};
/// A wrapper around `Box<RawValue>`. /// A wrapper around `Box<RawValue>` with a generic parameter for the expected Rust type.
///
/// To be used in place of any type in the Matrix endpoint definition to allow request and response
/// types to contain that said type represented by the generic argument `Ev`.
/// ///
/// Ruma offers the `Raw` wrapper to enable passing around JSON text that is only partially /// Ruma offers the `Raw` wrapper to enable passing around JSON text that is only partially
/// validated. This is useful when a client receives events that do not follow the spec perfectly /// validated. This is useful when a client receives events that do not follow the spec perfectly