Skip to content

Commit 868d2eb

Browse files
committed
Updated documentation
1 parent 9164c54 commit 868d2eb

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

crates/bevy_reflect/src/serde/deserialize_reflect.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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

crates/bevy_reflect/src/serde/serialize_reflect.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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 [`Derialize`] 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

0 commit comments

Comments
 (0)