You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/Summary/controlling-script-bindings.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Controlling Script Bindings
2
2
3
-
In this book we reffer to anything accessible by a script, which allows it to communicate with your Rust code a `binding` (which in previous versions was more generically referred to as a script API).
3
+
In this book we refer to anything accessible by a script, which allows it to communicate with your Rust code a `binding` (which in previous versions was more generically referred to as a script API).
4
4
5
5
The "binding" here being used as in: binding `script` code to `rust` code.
6
6
@@ -17,16 +17,16 @@ Everything callable by scripts must first be registered in the dynamic function
17
17
In order for a function to be callable by a script it must adhere to a few requirements:
18
18
- Each argument must implement `FromScript`.
19
19
- Each return type must implement `IntoScript`.
20
-
- Each argument must also implement `GetInnerTypeDependencies`
21
-
- Each return type must also implement `GetInnerTypeDependencies`
20
+
- Each argument must also implement `GetTypeDependencies`
21
+
- Each return type must also implement `GetTypeDependencies`
22
22
23
23
The into/from requirements allow us to convert these types to `ScriptValue`'s, and each supported scripting language can then marshall these into the script.
24
24
25
25
Note these types are implemented for primitives, but if you want to interact with one of your `Reflect` implementing types, you will need to use one of `Ref<T>`, `Mut<T>` or `Val<T>` wrappers in place of `&T`, `&mut T` and `T` respectively.
26
26
27
27
These wrappers enable us to safely interact with bevy, and claim any necessary mutex'es on `Resources`, `Components` or `Allocations`.
28
28
29
-
The `GetInnerTypeDependencies`, trait is simply a local trait alias for `GetTypeRegistration` with less strict type requirements. It allows us to register all the types necessary for the function calls, so that you don't have to register anything manually. If your type implements `GetTypeRegistration` you should not face any issues on this front.
29
+
The `GetTypeDependencies`, trait is simply a local trait alias for `GetTypeRegistration` with less strict type requirements. It allows us to register all the types necessary for the function calls, so that you don't have to register anything manually. If your type implements `GetTypeRegistration` you should not face any issues on this front.
30
30
31
31
## Registering Script Functions
32
32
@@ -130,4 +130,4 @@ There are a few reserved functions that you can override by registering them on
130
130
| display_ref | a display function, used for displaying a reference to a value | ❌ | ✅ |
131
131
| display_value | a display function, used for displaying a mutable reference to a value | ❌ | ✅ |
132
132
133
-
In this context `overridable` indicates whether language implementations will look for a specific function on your type before looking at the generic `ReflectReference` namespace. You can still remove the existing registration for these functions on the `ReflectReference` namespace if you want to replace them with your own implementation.
133
+
In this context `overridable` indicates whether language implementations will look for a specific function on your type before looking at the generic `ReflectReference` namespace. You can still remove the existing registration for these functions on the `ReflectReference` namespace if you want to replace them with your own implementation.
0 commit comments