135135//! For example, we can access our struct's fields by name using the [`Struct::field`] method.
136136//!
137137//! ```
138- //! # use bevy_reflect::{PartialReflect, Reflect, Struct};
138+ //! # use bevy_reflect::{PartialReflect, Reflect, structs:: Struct};
139139//! # #[derive(Reflect)]
140140//! # struct MyStruct {
141141//! # foo: i32
195195//! These dynamic types may contain any arbitrary reflected data.
196196//!
197197//! ```
198- //! # use bevy_reflect::{DynamicStruct, Struct};
198+ //! # use bevy_reflect::structs:: {DynamicStruct, Struct};
199199//! let mut data = DynamicStruct::default();
200200//! data.insert("foo", 123_i32);
201201//! assert_eq!(Some(&123), data.field("foo").unwrap().try_downcast_ref::<i32>())
209209//! we may pass them around just like most other reflected types.
210210//!
211211//! ```
212- //! # use bevy_reflect::{DynamicStruct, PartialReflect, Reflect};
212+ //! # use bevy_reflect::{structs:: DynamicStruct, PartialReflect, Reflect};
213213//! # #[derive(Reflect)]
214214//! # struct MyStruct {
215215//! # foo: i32
243243//! or when trying to make use of a reflected trait which expects the actual type.
244244//!
245245//! ```should_panic
246- //! # use bevy_reflect::{DynamicStruct, PartialReflect, Reflect};
246+ //! # use bevy_reflect::{structs:: DynamicStruct, PartialReflect, Reflect};
247247//! # #[derive(Reflect)]
248248//! # struct MyStruct {
249249//! # foo: i32
545545//! [`List`]: crate::list::List
546546//! [`Set`]: crate::set::Set
547547//! [`Map`]: crate::map::Map
548+ //! [`Struct`]: crate::structs::Struct
548549//! [`Enum`]: crate::enums::Enum
549550//! [`Function`]: crate::func::Function
551+ //! [`Struct::field`]: crate::structs::Struct::field
550552//! [`DynamicArray`]: crate::array::DynamicArray
551553//! [`DynamicList`]: crate::list::DynamicList
552554//! [`DynamicMap`]: crate::map::DynamicMap
555+ //! [`DynamicStruct`]: crate::structs::DynamicStruct
553556//! [`DynamicEnum`]: crate::enums::DynamicEnum
554557//! [derive macro documentation]: derive@crate::Reflect
555558//! [deriving `Reflect`]: derive@crate::Reflect
@@ -602,7 +605,7 @@ mod reflect;
602605mod reflectable;
603606mod remote;
604607pub mod set;
605- mod struct_trait ;
608+ pub mod structs ;
606609mod tuple;
607610mod tuple_struct;
608611mod type_info;
@@ -653,9 +656,10 @@ pub mod prelude {
653656
654657 #[ doc( hidden) ]
655658 pub use crate :: {
656- reflect_trait, FromReflect , GetField , GetPath , GetTupleStructField , PartialReflect ,
657- Reflect , ReflectDeserialize , ReflectFromReflect , ReflectPath , ReflectSerialize , Struct ,
658- TupleStruct , TypePath ,
659+ reflect_trait,
660+ structs:: { GetField , Struct } ,
661+ FromReflect , GetPath , GetTupleStructField , PartialReflect , Reflect , ReflectDeserialize ,
662+ ReflectFromReflect , ReflectPath , ReflectSerialize , TupleStruct , TypePath ,
659663 } ;
660664
661665 #[ cfg( feature = "functions" ) ]
@@ -672,7 +676,6 @@ pub use path::*;
672676pub use reflect:: * ;
673677pub use reflectable:: * ;
674678pub use remote:: * ;
675- pub use struct_trait:: * ;
676679pub use tuple:: * ;
677680pub use tuple_struct:: * ;
678681pub use type_info:: * ;
@@ -688,8 +691,9 @@ pub use erased_serde;
688691#[ doc( hidden) ]
689692pub mod __macro_exports {
690693 use crate :: {
691- array:: DynamicArray , enums:: DynamicEnum , list:: DynamicList , map:: DynamicMap , DynamicStruct ,
692- DynamicTuple , DynamicTupleStruct , GetTypeRegistration , TypeRegistry ,
694+ array:: DynamicArray , enums:: DynamicEnum , list:: DynamicList , map:: DynamicMap ,
695+ structs:: DynamicStruct , DynamicTuple , DynamicTupleStruct , GetTypeRegistration ,
696+ TypeRegistry ,
693697 } ;
694698
695699 /// Re-exports of items from the [`alloc`] crate.
@@ -868,7 +872,7 @@ mod tests {
868872 } ;
869873 use static_assertions:: { assert_impl_all, assert_not_impl_all} ;
870874
871- use super :: { array:: * , enums:: * , list:: * , map:: * , prelude:: * , * } ;
875+ use super :: { array:: * , enums:: * , list:: * , map:: * , prelude:: * , structs :: * , * } ;
872876 use crate :: {
873877 serde:: { ReflectDeserializer , ReflectSerializer } ,
874878 utility:: GenericTypePathCell ,
0 commit comments