
# Objective
`bevy_reflect` can be a moderately complex crate to try and understand. It has many moving parts, a handful of gotchas, and a few subtle contracts that aren't immediately obvious to users and even other contributors.
The current README does an okay job demonstrating how the crate can be used. However, the crate's actual documentation should give a better overview of the crate, its inner-workings, and show some of its own examples.
## Solution
Added crate-level documentation that attempts to summarize the main parts of `bevy_reflect` into small sections.
This PR also updates the documentation for:
- `Reflect`
- `FromReflect`
- The reflection subtraits
- Other important types and traits
- The reflection macros (including the derive macros)
- Crate features
### Open Questions
1. ~~Should I update the docs for the Dynamic types? I was originally going to, but I'm getting a little concerned about the size of this PR 😅~~ Decided to not do this in this PR. It'll be better served from its own PR.
2. Should derive macro documentation be moved to the trait itself? This could improve visibility and allow for better doc links, but could also clutter up the trait's documentation (as well as not being on the actual derive macro's documentation).
### TODO
- [ ] ~~Document Dynamic types (?)~~ I think this should be done in a separate PR.
- [x] Document crate features
- [x] Update docs for `GetTypeRegistration`
- [x] Update docs for `TypeRegistration`
- [x] Update docs for `derive_from_reflect`
- [x] Document `reflect_trait`
- [x] Document `impl_reflect_value`
- [x] Document `impl_from_reflect_value`
---
## Changelog
- Updated documentation across the `bevy_reflect` crate
- Removed `#[module]` helper attribute for `Reflect` derives (this is not currently used)
## Migration Guide
- Removed `#[module]` helper attribute for `Reflect` derives. If your code is relying on this attribute, please replace it with either `#[reflect]` or `#[reflect_value]` (dependent on use-case).
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
625 lines
17 KiB
Rust
625 lines
17 KiB
Rust
use crate::utility::NonGenericTypeInfoCell;
|
|
use crate::{
|
|
DynamicInfo, FromReflect, GetTypeRegistration, Reflect, ReflectMut, ReflectOwned, ReflectRef,
|
|
TypeInfo, TypeRegistration, Typed, UnnamedField,
|
|
};
|
|
use std::any::{Any, TypeId};
|
|
use std::fmt::{Debug, Formatter};
|
|
use std::slice::Iter;
|
|
|
|
/// A trait used to power [tuple-like] operations via [reflection].
|
|
///
|
|
/// This trait uses the [`Reflect`] trait to allow implementors to have their fields
|
|
/// be dynamically addressed by index.
|
|
///
|
|
/// This trait is automatically implemented for arbitrary tuples of up to 12
|
|
/// elements, provided that each element implements [`Reflect`].
|
|
///
|
|
/// # Example
|
|
///
|
|
/// ```
|
|
/// use bevy_reflect::{Reflect, Tuple};
|
|
///
|
|
/// let foo = (123_u32, true);
|
|
/// assert_eq!(foo.field_len(), 2);
|
|
///
|
|
/// let field: &dyn Reflect = foo.field(0).unwrap();
|
|
/// assert_eq!(field.downcast_ref::<u32>(), Some(&123));
|
|
/// ```
|
|
///
|
|
/// [tuple-like]: https://doc.rust-lang.org/book/ch03-02-data-types.html#the-tuple-type
|
|
/// [reflection]: crate
|
|
pub trait Tuple: Reflect {
|
|
/// Returns a reference to the value of the field with index `index` as a
|
|
/// `&dyn Reflect`.
|
|
fn field(&self, index: usize) -> Option<&dyn Reflect>;
|
|
|
|
/// Returns a mutable reference to the value of the field with index `index`
|
|
/// as a `&mut dyn Reflect`.
|
|
fn field_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>;
|
|
|
|
/// Returns the number of fields in the tuple.
|
|
fn field_len(&self) -> usize;
|
|
|
|
/// Returns an iterator over the values of the tuple's fields.
|
|
fn iter_fields(&self) -> TupleFieldIter;
|
|
|
|
/// Drain the fields of this tuple to get a vector of owned values.
|
|
fn drain(self: Box<Self>) -> Vec<Box<dyn Reflect>>;
|
|
|
|
/// Clones the struct into a [`DynamicTuple`].
|
|
fn clone_dynamic(&self) -> DynamicTuple;
|
|
}
|
|
|
|
/// An iterator over the field values of a tuple.
|
|
pub struct TupleFieldIter<'a> {
|
|
pub(crate) tuple: &'a dyn Tuple,
|
|
pub(crate) index: usize,
|
|
}
|
|
|
|
impl<'a> TupleFieldIter<'a> {
|
|
pub fn new(value: &'a dyn Tuple) -> Self {
|
|
TupleFieldIter {
|
|
tuple: value,
|
|
index: 0,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl<'a> Iterator for TupleFieldIter<'a> {
|
|
type Item = &'a dyn Reflect;
|
|
|
|
fn next(&mut self) -> Option<Self::Item> {
|
|
let value = self.tuple.field(self.index);
|
|
self.index += 1;
|
|
value
|
|
}
|
|
|
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
|
let size = self.tuple.field_len();
|
|
(size, Some(size))
|
|
}
|
|
}
|
|
|
|
impl<'a> ExactSizeIterator for TupleFieldIter<'a> {}
|
|
|
|
/// A convenience trait which combines fetching and downcasting of tuple
|
|
/// fields.
|
|
///
|
|
/// # Example
|
|
///
|
|
/// ```
|
|
/// use bevy_reflect::GetTupleField;
|
|
///
|
|
/// # fn main() {
|
|
/// let foo = ("blue".to_string(), 42_i32);
|
|
///
|
|
/// assert_eq!(foo.get_field::<String>(0), Some(&"blue".to_string()));
|
|
/// assert_eq!(foo.get_field::<i32>(1), Some(&42));
|
|
/// # }
|
|
/// ```
|
|
pub trait GetTupleField {
|
|
/// Returns a reference to the value of the field with index `index`,
|
|
/// downcast to `T`.
|
|
fn get_field<T: Reflect>(&self, index: usize) -> Option<&T>;
|
|
|
|
/// Returns a mutable reference to the value of the field with index
|
|
/// `index`, downcast to `T`.
|
|
fn get_field_mut<T: Reflect>(&mut self, index: usize) -> Option<&mut T>;
|
|
}
|
|
|
|
impl<S: Tuple> GetTupleField for S {
|
|
fn get_field<T: Reflect>(&self, index: usize) -> Option<&T> {
|
|
self.field(index)
|
|
.and_then(|value| value.downcast_ref::<T>())
|
|
}
|
|
|
|
fn get_field_mut<T: Reflect>(&mut self, index: usize) -> Option<&mut T> {
|
|
self.field_mut(index)
|
|
.and_then(|value| value.downcast_mut::<T>())
|
|
}
|
|
}
|
|
|
|
impl GetTupleField for dyn Tuple {
|
|
fn get_field<T: Reflect>(&self, index: usize) -> Option<&T> {
|
|
self.field(index)
|
|
.and_then(|value| value.downcast_ref::<T>())
|
|
}
|
|
|
|
fn get_field_mut<T: Reflect>(&mut self, index: usize) -> Option<&mut T> {
|
|
self.field_mut(index)
|
|
.and_then(|value| value.downcast_mut::<T>())
|
|
}
|
|
}
|
|
|
|
/// A container for compile-time tuple info.
|
|
#[derive(Clone, Debug)]
|
|
pub struct TupleInfo {
|
|
type_name: &'static str,
|
|
type_id: TypeId,
|
|
fields: Box<[UnnamedField]>,
|
|
#[cfg(feature = "documentation")]
|
|
docs: Option<&'static str>,
|
|
}
|
|
|
|
impl TupleInfo {
|
|
/// Create a new [`TupleInfo`].
|
|
///
|
|
/// # Arguments
|
|
///
|
|
/// * `fields`: The fields of this tuple in the order they are defined
|
|
///
|
|
pub fn new<T: Reflect>(fields: &[UnnamedField]) -> Self {
|
|
Self {
|
|
type_name: std::any::type_name::<T>(),
|
|
type_id: TypeId::of::<T>(),
|
|
fields: fields.to_vec().into_boxed_slice(),
|
|
#[cfg(feature = "documentation")]
|
|
docs: None,
|
|
}
|
|
}
|
|
|
|
/// Sets the docstring for this tuple.
|
|
#[cfg(feature = "documentation")]
|
|
pub fn with_docs(self, docs: Option<&'static str>) -> Self {
|
|
Self { docs, ..self }
|
|
}
|
|
|
|
/// Get the field at the given index.
|
|
pub fn field_at(&self, index: usize) -> Option<&UnnamedField> {
|
|
self.fields.get(index)
|
|
}
|
|
|
|
/// Iterate over the fields of this tuple.
|
|
pub fn iter(&self) -> Iter<'_, UnnamedField> {
|
|
self.fields.iter()
|
|
}
|
|
|
|
/// The total number of fields in this tuple.
|
|
pub fn field_len(&self) -> usize {
|
|
self.fields.len()
|
|
}
|
|
|
|
/// The [type name] of the tuple.
|
|
///
|
|
/// [type name]: std::any::type_name
|
|
pub fn type_name(&self) -> &'static str {
|
|
self.type_name
|
|
}
|
|
|
|
/// The [`TypeId`] of the tuple.
|
|
pub fn type_id(&self) -> TypeId {
|
|
self.type_id
|
|
}
|
|
|
|
/// Check if the given type matches the tuple type.
|
|
pub fn is<T: Any>(&self) -> bool {
|
|
TypeId::of::<T>() == self.type_id
|
|
}
|
|
|
|
/// The docstring of this tuple, if any.
|
|
#[cfg(feature = "documentation")]
|
|
pub fn docs(&self) -> Option<&'static str> {
|
|
self.docs
|
|
}
|
|
}
|
|
|
|
/// A tuple which allows fields to be added at runtime.
|
|
#[derive(Default, Debug)]
|
|
pub struct DynamicTuple {
|
|
name: String,
|
|
fields: Vec<Box<dyn Reflect>>,
|
|
}
|
|
|
|
impl DynamicTuple {
|
|
/// Returns the type name of the tuple.
|
|
///
|
|
/// The tuple's name is automatically generated from its element types.
|
|
pub fn name(&self) -> &str {
|
|
&self.name
|
|
}
|
|
|
|
/// Manually sets the type name of the tuple.
|
|
///
|
|
/// Note that the tuple name will be overwritten when elements are added.
|
|
pub fn set_name(&mut self, name: String) {
|
|
self.name = name;
|
|
}
|
|
|
|
/// Appends an element with value `value` to the tuple.
|
|
pub fn insert_boxed(&mut self, value: Box<dyn Reflect>) {
|
|
self.fields.push(value);
|
|
self.generate_name();
|
|
}
|
|
|
|
/// Appends a typed element with value `value` to the tuple.
|
|
pub fn insert<T: Reflect>(&mut self, value: T) {
|
|
self.insert_boxed(Box::new(value));
|
|
self.generate_name();
|
|
}
|
|
|
|
fn generate_name(&mut self) {
|
|
let name = &mut self.name;
|
|
name.clear();
|
|
name.push('(');
|
|
for (i, field) in self.fields.iter().enumerate() {
|
|
if i > 0 {
|
|
name.push_str(", ");
|
|
}
|
|
name.push_str(field.type_name());
|
|
}
|
|
name.push(')');
|
|
}
|
|
}
|
|
|
|
impl Tuple for DynamicTuple {
|
|
#[inline]
|
|
fn field(&self, index: usize) -> Option<&dyn Reflect> {
|
|
self.fields.get(index).map(|field| &**field)
|
|
}
|
|
|
|
#[inline]
|
|
fn field_mut(&mut self, index: usize) -> Option<&mut dyn Reflect> {
|
|
self.fields.get_mut(index).map(|field| &mut **field)
|
|
}
|
|
|
|
#[inline]
|
|
fn field_len(&self) -> usize {
|
|
self.fields.len()
|
|
}
|
|
|
|
#[inline]
|
|
fn iter_fields(&self) -> TupleFieldIter {
|
|
TupleFieldIter {
|
|
tuple: self,
|
|
index: 0,
|
|
}
|
|
}
|
|
|
|
#[inline]
|
|
fn drain(self: Box<Self>) -> Vec<Box<dyn Reflect>> {
|
|
self.fields
|
|
}
|
|
|
|
#[inline]
|
|
fn clone_dynamic(&self) -> DynamicTuple {
|
|
DynamicTuple {
|
|
name: self.name.clone(),
|
|
fields: self
|
|
.fields
|
|
.iter()
|
|
.map(|value| value.clone_value())
|
|
.collect(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Reflect for DynamicTuple {
|
|
#[inline]
|
|
fn type_name(&self) -> &str {
|
|
self.name()
|
|
}
|
|
|
|
#[inline]
|
|
fn get_type_info(&self) -> &'static TypeInfo {
|
|
<Self as Typed>::type_info()
|
|
}
|
|
|
|
#[inline]
|
|
fn into_any(self: Box<Self>) -> Box<dyn Any> {
|
|
self
|
|
}
|
|
|
|
#[inline]
|
|
fn as_any(&self) -> &dyn Any {
|
|
self
|
|
}
|
|
|
|
#[inline]
|
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
|
self
|
|
}
|
|
|
|
#[inline]
|
|
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect> {
|
|
self
|
|
}
|
|
|
|
#[inline]
|
|
fn as_reflect(&self) -> &dyn Reflect {
|
|
self
|
|
}
|
|
|
|
#[inline]
|
|
fn as_reflect_mut(&mut self) -> &mut dyn Reflect {
|
|
self
|
|
}
|
|
|
|
#[inline]
|
|
fn clone_value(&self) -> Box<dyn Reflect> {
|
|
Box::new(self.clone_dynamic())
|
|
}
|
|
|
|
#[inline]
|
|
fn reflect_ref(&self) -> ReflectRef {
|
|
ReflectRef::Tuple(self)
|
|
}
|
|
|
|
#[inline]
|
|
fn reflect_mut(&mut self) -> ReflectMut {
|
|
ReflectMut::Tuple(self)
|
|
}
|
|
|
|
#[inline]
|
|
fn reflect_owned(self: Box<Self>) -> ReflectOwned {
|
|
ReflectOwned::Tuple(self)
|
|
}
|
|
|
|
fn apply(&mut self, value: &dyn Reflect) {
|
|
tuple_apply(self, value);
|
|
}
|
|
|
|
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>> {
|
|
*self = value.take()?;
|
|
Ok(())
|
|
}
|
|
|
|
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool> {
|
|
tuple_partial_eq(self, value)
|
|
}
|
|
|
|
fn debug(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "DynamicTuple(")?;
|
|
tuple_debug(self, f)?;
|
|
write!(f, ")")
|
|
}
|
|
}
|
|
|
|
impl Typed for DynamicTuple {
|
|
fn type_info() -> &'static TypeInfo {
|
|
static CELL: NonGenericTypeInfoCell = NonGenericTypeInfoCell::new();
|
|
CELL.get_or_set(|| TypeInfo::Dynamic(DynamicInfo::new::<Self>()))
|
|
}
|
|
}
|
|
|
|
/// Applies the elements of `b` to the corresponding elements of `a`.
|
|
///
|
|
/// # Panics
|
|
///
|
|
/// This function panics if `b` is not a tuple.
|
|
#[inline]
|
|
pub fn tuple_apply<T: Tuple>(a: &mut T, b: &dyn Reflect) {
|
|
if let ReflectRef::Tuple(tuple) = b.reflect_ref() {
|
|
for (i, value) in tuple.iter_fields().enumerate() {
|
|
if let Some(v) = a.field_mut(i) {
|
|
v.apply(value);
|
|
}
|
|
}
|
|
} else {
|
|
panic!("Attempted to apply non-Tuple type to Tuple type.");
|
|
}
|
|
}
|
|
|
|
/// Compares a [`Tuple`] with a [`Reflect`] value.
|
|
///
|
|
/// Returns true if and only if all of the following are true:
|
|
/// - `b` is a tuple;
|
|
/// - `b` has the same number of elements as `a`;
|
|
/// - [`Reflect::reflect_partial_eq`] returns `Some(true)` for pairwise elements of `a` and `b`.
|
|
///
|
|
/// Returns [`None`] if the comparison couldn't even be performed.
|
|
#[inline]
|
|
pub fn tuple_partial_eq<T: Tuple>(a: &T, b: &dyn Reflect) -> Option<bool> {
|
|
let ReflectRef::Tuple(b) = b.reflect_ref() else {
|
|
return Some(false);
|
|
};
|
|
|
|
if a.field_len() != b.field_len() {
|
|
return Some(false);
|
|
}
|
|
|
|
for (a_field, b_field) in a.iter_fields().zip(b.iter_fields()) {
|
|
let eq_result = a_field.reflect_partial_eq(b_field);
|
|
if let failed @ (Some(false) | None) = eq_result {
|
|
return failed;
|
|
}
|
|
}
|
|
|
|
Some(true)
|
|
}
|
|
|
|
/// The default debug formatter for [`Tuple`] types.
|
|
///
|
|
/// # Example
|
|
/// ```
|
|
/// use bevy_reflect::Reflect;
|
|
///
|
|
/// let my_tuple: &dyn Reflect = &(1, 2, 3);
|
|
/// println!("{:#?}", my_tuple);
|
|
///
|
|
/// // Output:
|
|
///
|
|
/// // (
|
|
/// // 1,
|
|
/// // 2,
|
|
/// // 3,
|
|
/// // )
|
|
/// ```
|
|
#[inline]
|
|
pub fn tuple_debug(dyn_tuple: &dyn Tuple, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
let mut debug = f.debug_tuple("");
|
|
for field in dyn_tuple.iter_fields() {
|
|
debug.field(&field as &dyn Debug);
|
|
}
|
|
debug.finish()
|
|
}
|
|
|
|
macro_rules! impl_reflect_tuple {
|
|
{$($index:tt : $name:tt),*} => {
|
|
impl<$($name: Reflect),*> Tuple for ($($name,)*) {
|
|
#[inline]
|
|
fn field(&self, index: usize) -> Option<&dyn Reflect> {
|
|
match index {
|
|
$($index => Some(&self.$index as &dyn Reflect),)*
|
|
_ => None,
|
|
}
|
|
}
|
|
|
|
#[inline]
|
|
fn field_mut(&mut self, index: usize) -> Option<&mut dyn Reflect> {
|
|
match index {
|
|
$($index => Some(&mut self.$index as &mut dyn Reflect),)*
|
|
_ => None,
|
|
}
|
|
}
|
|
|
|
#[inline]
|
|
fn field_len(&self) -> usize {
|
|
let indices: &[usize] = &[$($index as usize),*];
|
|
indices.len()
|
|
}
|
|
|
|
#[inline]
|
|
fn iter_fields(&self) -> TupleFieldIter {
|
|
TupleFieldIter {
|
|
tuple: self,
|
|
index: 0,
|
|
}
|
|
}
|
|
|
|
#[inline]
|
|
fn drain(self: Box<Self>) -> Vec<Box<dyn Reflect>> {
|
|
vec![
|
|
$(Box::new(self.$index),)*
|
|
]
|
|
}
|
|
|
|
#[inline]
|
|
fn clone_dynamic(&self) -> DynamicTuple {
|
|
let mut dyn_tuple = DynamicTuple {
|
|
name: String::default(),
|
|
fields: self
|
|
.iter_fields()
|
|
.map(|value| value.clone_value())
|
|
.collect(),
|
|
};
|
|
dyn_tuple.generate_name();
|
|
dyn_tuple
|
|
}
|
|
}
|
|
|
|
impl<$($name: Reflect),*> Reflect for ($($name,)*) {
|
|
fn type_name(&self) -> &str {
|
|
std::any::type_name::<Self>()
|
|
}
|
|
|
|
fn get_type_info(&self) -> &'static TypeInfo {
|
|
<Self as Typed>::type_info()
|
|
}
|
|
|
|
fn into_any(self: Box<Self>) -> Box<dyn Any> {
|
|
self
|
|
}
|
|
|
|
fn as_any(&self) -> &dyn Any {
|
|
self
|
|
}
|
|
|
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
|
self
|
|
}
|
|
|
|
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect> {
|
|
self
|
|
}
|
|
|
|
fn as_reflect(&self) -> &dyn Reflect {
|
|
self
|
|
}
|
|
|
|
fn as_reflect_mut(&mut self) -> &mut dyn Reflect {
|
|
self
|
|
}
|
|
|
|
fn apply(&mut self, value: &dyn Reflect) {
|
|
crate::tuple_apply(self, value);
|
|
}
|
|
|
|
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>> {
|
|
*self = value.take()?;
|
|
Ok(())
|
|
}
|
|
|
|
fn reflect_ref(&self) -> ReflectRef {
|
|
ReflectRef::Tuple(self)
|
|
}
|
|
|
|
fn reflect_mut(&mut self) -> ReflectMut {
|
|
ReflectMut::Tuple(self)
|
|
}
|
|
|
|
fn reflect_owned(self: Box<Self>) -> ReflectOwned {
|
|
ReflectOwned::Tuple(self)
|
|
}
|
|
|
|
fn clone_value(&self) -> Box<dyn Reflect> {
|
|
Box::new(self.clone_dynamic())
|
|
}
|
|
|
|
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool> {
|
|
crate::tuple_partial_eq(self, value)
|
|
}
|
|
}
|
|
|
|
impl <$($name: Reflect),*> Typed for ($($name,)*) {
|
|
fn type_info() -> &'static TypeInfo {
|
|
static CELL: $crate::utility::GenericTypeInfoCell = $crate::utility::GenericTypeInfoCell::new();
|
|
CELL.get_or_insert::<Self, _>(|| {
|
|
let fields = [
|
|
$(UnnamedField::new::<$name>($index),)*
|
|
];
|
|
let info = TupleInfo::new::<Self>(&fields);
|
|
TypeInfo::Tuple(info)
|
|
})
|
|
}
|
|
}
|
|
|
|
impl<$($name: Reflect + Typed),*> GetTypeRegistration for ($($name,)*) {
|
|
fn get_type_registration() -> TypeRegistration {
|
|
TypeRegistration::of::<($($name,)*)>()
|
|
}
|
|
}
|
|
|
|
impl<$($name: FromReflect),*> FromReflect for ($($name,)*)
|
|
{
|
|
fn from_reflect(reflect: &dyn Reflect) -> Option<Self> {
|
|
if let ReflectRef::Tuple(_ref_tuple) = reflect.reflect_ref() {
|
|
Some(
|
|
(
|
|
$(
|
|
<$name as FromReflect>::from_reflect(_ref_tuple.field($index)?)?,
|
|
)*
|
|
)
|
|
)
|
|
} else {
|
|
None
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
impl_reflect_tuple! {}
|
|
impl_reflect_tuple! {0: A}
|
|
impl_reflect_tuple! {0: A, 1: B}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G, 7: H}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G, 7: H, 8: I}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G, 7: H, 8: I, 9: J}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G, 7: H, 8: I, 9: J, 10: K}
|
|
impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G, 7: H, 8: I, 9: J, 10: K, 11: L}
|