mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Also added a bit to the paragraph to explain when to use the new function. Fixes #15188.
This commit is contained in:
parent
378dcacf82
commit
612731edfb
1 changed files with 6 additions and 4 deletions
|
@ -172,15 +172,17 @@ pub enum TypeInfoError {
|
||||||
|
|
||||||
/// Compile-time type information for various reflected types.
|
/// Compile-time type information for various reflected types.
|
||||||
///
|
///
|
||||||
/// Generally, for any given type, this value can be retrieved one of three ways:
|
/// Generally, for any given type, this value can be retrieved in one of four ways:
|
||||||
///
|
///
|
||||||
/// 1. [`Typed::type_info`]
|
/// 1. [`Typed::type_info`]
|
||||||
/// 2. [`PartialReflect::get_represented_type_info`]
|
/// 2. [`DynamicTyped::reflect_type_info`]
|
||||||
/// 3. [`TypeRegistry::get_type_info`]
|
/// 3. [`PartialReflect::get_represented_type_info`]
|
||||||
|
/// 4. [`TypeRegistry::get_type_info`]
|
||||||
///
|
///
|
||||||
/// Each return a static reference to [`TypeInfo`], but they all have their own use cases.
|
/// Each return a static reference to [`TypeInfo`], but they all have their own use cases.
|
||||||
/// For example, if you know the type at compile time, [`Typed::type_info`] is probably
|
/// For example, if you know the type at compile time, [`Typed::type_info`] is probably
|
||||||
/// the simplest. If all you have is a `dyn PartialReflect`, you'll probably want [`PartialReflect::get_represented_type_info`].
|
/// the simplest. If you have a `dyn Reflect` you can use [`DynamicTyped::reflect_type_info`].
|
||||||
|
/// If all you have is a `dyn PartialReflect`, you'll probably want [`PartialReflect::get_represented_type_info`].
|
||||||
/// Lastly, if all you have is a [`TypeId`] or [type path], you will need to go through
|
/// Lastly, if all you have is a [`TypeId`] or [type path], you will need to go through
|
||||||
/// [`TypeRegistry::get_type_info`].
|
/// [`TypeRegistry::get_type_info`].
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue