1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use crateReflect;
/// Marks a type as a [reflectable] wrapper for a remote type.
///
/// This allows types from external libraries (remote types) to be included in reflection.
///
/// The [`#[reflect_remote]`](crate::reflect_remote) attribute macro generates a
/// `#[repr(transparent)]` wrapper and an implementation of this trait. Its conversion methods
/// use the wrapper's transparent representation.
///
/// Manual implementations may use different representation and conversion behavior. The
/// associated `Remote` type identifies the remote type represented by this wrapper.
///
/// # Example
///
/// ```
/// use bevy_reflect_derive::{reflect_remote, Reflect};
///
/// mod some_lib {
/// pub struct TheirType {
/// pub value: u32
/// }
/// }
///
/// #[reflect_remote(some_lib::TheirType)]
/// struct MyType {
/// pub value: u32
/// }
///
/// #[derive(Reflect)]
/// struct MyStruct {
/// #[reflect(remote = MyType)]
/// data: some_lib::TheirType,
/// }
/// ```
///
/// [reflectable]: Reflect