Skip to content

Commit 71de41c

Browse files
committed
Document features
1 parent dbf14ec commit 71de41c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

crates/bevy_reflect/src/lib.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,32 @@
350350
//! assert_eq!(original_value, converted_value);
351351
//! ```
352352
//!
353+
//! # Features
354+
//!
355+
//! ## `bevy`
356+
//!
357+
//! | Default | Dependencies |
358+
//! | :-----: | :---------------------------------------: |
359+
//! | ❌ | [`bevy_math`], [`glam`], [`smallvec`] |
360+
//!
361+
//! This feature makes it so that the appropriate reflection traits are implemented on all the types
362+
//! necessary for the [Bevy] game engine.
363+
//! enables the optional dependencies: [`bevy_math`], [`glam`], and [`smallvec`].
364+
//! These dependencies are used by the [Bevy] game engine and must define their reflection implementations
365+
//! within this crate due to Rust's [orphan rule].
366+
//!
367+
//! ## `documentation`
368+
//!
369+
//! | Default | Dependencies |
370+
//! | :-----: | :-------------------------------------------: |
371+
//! | ❌ | [`bevy_reflect_derive/documentation`] |
372+
//!
373+
//! This feature enables capturing doc comments as strings for items that [derive `Reflect`].
374+
//! Documentation information can then be accessed at runtime on the [`TypeInfo`] of that item.
375+
//!
376+
//! This can be useful for generating documentation for scripting language interop or
377+
//! for displaying tooltips in an editor.
378+
//!
353379
//! [Reflection]: https://en.wikipedia.org/wiki/Reflective_programming
354380
//! [Bevy]: https://bevyengine.org/
355381
//! [`bevy_reflect`]: crate
@@ -368,6 +394,12 @@
368394
//! [registry]: TypeRegistry
369395
//! [type information]: TypeInfo
370396
//! [type name]: Reflect::type_name
397+
//! [`bevy_math`]: https://docs.rs/bevy_math/latest/bevy_math/
398+
//! [`glam`]: https://docs.rs/glam/latest/glam/
399+
//! [`smallvec`]: https://docs.rs/smallvec/latest/smallvec/
400+
//! [orphan rule]: https://doc.rust-lang.org/book/ch10-02-traits.html#implementing-a-trait-on-a-type:~:text=But%20we%20can%E2%80%99t,implementation%20to%20use.
401+
//! [`bevy_reflect_derive/documentation`]: bevy_reflect_derive
402+
//! [derive `Reflect`]: bevy_reflect_derive::Reflect
371403
372404
mod array;
373405
mod fields;

0 commit comments

Comments
 (0)