File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
crates/bevy_reflect/src/serde Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,18 @@ use serde::{Deserialize, Deserializer};
1313/// want to handle parts of the deserialization process, but temporarily pass control
1414/// to the standard reflection deserializer for other parts.
1515///
16+ /// For the serializtion equivalent of this trait, see [`SerializeReflect`].
17+ ///
18+ /// # Rationale
19+ ///
1620/// Without this trait and its associated [type data], such a deserializer would have to
1721/// write out all of the deserialization logic itself, possibly including
1822/// unnecessary code duplication and trivial implementations.
1923///
24+ /// This is because a normal [`Deserialize`] implementation has no knowledge of the
25+ /// [`TypeRegistry`] and therefore cannot create a reflection-based deserializer for
26+ /// nested items.
27+ ///
2028/// # Implementors
2129///
2230/// In order for this to work with the reflection deserializers like [`TypedReflectDeserializer`]
@@ -26,8 +34,9 @@ use serde::{Deserialize, Deserializer};
2634/// the type definition.
2735///
2836/// Note that this trait has a blanket implementation for all types that implement
29- /// [`Reflect`] and [`Deserialize`].
37+ /// [`Reflect`] and [`Deserialize`] which just calls the normal [`Deserialize`] implementation .
3038///
39+ /// [`SerializeReflect`]: crate::serde::SerializeReflect
3140/// [type data]: ReflectDeserializeReflect
3241/// [`TypedReflectDeserializer`]: crate::serde::TypedReflectDeserializer
3342/// [`UntypedReflectDeserializer`]: crate::serde::UntypedReflectDeserializer
Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ use serde::{Serialize, Serializer};
1313/// want to handle parts of the serialization process, but temporarily pass control
1414/// to the standard reflection serializer for other parts.
1515///
16+ /// For the deserializtion equivalent of this trait, see [`DeserializeReflect`].
17+ ///
18+ /// # Rationale
19+ ///
1620/// Without this trait and its associated [type data], such a serializer would have to
1721/// write out all of the serialization logic itself, possibly including
1822/// unnecessary code duplication and trivial implementations.
1923///
20- /// For the deserializtion equivalent of this trait, see [`DeserializeReflect`].
24+ /// This is because a normal [`Serialize`] implementation has no knowledge of the
25+ /// [`TypeRegistry`] and therefore cannot create a reflection-based serializer for
26+ /// nested items.
2127///
2228/// # Implementors
2329///
@@ -28,8 +34,9 @@ use serde::{Serialize, Serializer};
2834/// the type definition.
2935///
3036/// Note that this trait has a blanket implementation for all types that implement
31- /// [`Reflect`] and [`Serialize`].
37+ /// [`Reflect`] and [`Serialize`] which just calls the normal [`Serialize`] implementation .
3238///
39+ /// [`DeserializeReflect`]: crate::serde::DeserializeReflect
3340/// [type data]: ReflectSerializeReflect
3441/// [`TypedReflectSerializer`]: crate::serde::TypedReflectSerializer
3542/// [`ReflectSerializer`]: crate::serde::ReflectSerializer
You can’t perform that action at this time.
0 commit comments