|
1 | 1 | //! # Rust bindings for the Godot game engine
|
2 | 2 | //!
|
3 |
| -//! This crate contains high-level wrappers around the Godot game engine's gdnative API. |
| 3 | +//! This crate contains high-level wrappers around the Godot game engine's GDNative API. |
4 | 4 | //! Some of the types were automatically generated from the engine's JSON API description,
|
5 | 5 | //! and some other types are hand made wrappers around the core C types.
|
6 | 6 | //!
|
7 |
| -//! ## Memory management for core types |
| 7 | +//! ## Core types |
8 | 8 | //!
|
9 |
| -//! Wrappers for most core types expose safe Rust interfaces, and it's unnecessary to mind |
10 |
| -//! memory management most of the times. The exceptions are `VariantArray` and `Dictionary`, |
11 |
| -//! internally reference-counted collections with "interior mutability" in Rust parlance. These |
12 |
| -//! types are modelled using the "typestate" pattern to enforce that the official |
| 9 | +//! Wrappers for most core types expose safe Rust interfaces, and it's unnecessary |
| 10 | +//! to mind memory management most of the times. The exceptions are |
| 11 | +//! [`VariantArray`](core_types::VariantArray) and [`Dictionary`](core_types::Dictionary), |
| 12 | +//! internally reference-counted collections with _interior mutability_ in Rust parlance. |
| 13 | +//! These types are modelled using the _typestate_ pattern to enforce that the official |
13 | 14 | //! [thread-safety guidelines][thread-safety]. For more information, read the type-level
|
14 | 15 | //! documentation for these types.
|
15 | 16 | //!
|
|
20 | 21 | //!
|
21 | 22 | //! ## Generated API types
|
22 | 23 | //!
|
23 |
| -//! The `api` module contains high-level wrappers for all the API types generated from a |
24 |
| -//! JSON description of the API. The generated types are tied to a specific version, which |
25 |
| -//! is currently `3.2.3-stable` for the crates.io version. If you want to use the bindings with |
26 |
| -//! another version of the engine, read the notes on the `custom-godot` feature flag below. |
| 24 | +//! The [`api`] module contains high-level wrappers for all the API types generated from a |
| 25 | +//! JSON description of the API. The generated types are tied to a specific version, typically |
| 26 | +//! the latest Godot 3.x release (at the time of the godot-rust release). |
| 27 | +//! If you want to use the bindings with another version of the engine, read the notes on |
| 28 | +//! the `custom-godot` feature flag below. |
27 | 29 | //!
|
28 | 30 | //! ### Memory management
|
29 | 31 | //!
|
30 | 32 | //! API types may be reference-counted or manually-managed. This is indicated by the
|
31 | 33 | //! `RefCounted` and `ManuallyManaged` marker traits.
|
32 | 34 | //!
|
33 |
| -//! The API types can exist in three reference forms: bare, `TRef` and `Ref`. Bare references |
34 |
| -//! to API types, like `&'a Node`, represent valid and safe references to Godot objects. |
| 35 | +//! The API types can exist in three reference forms: bare, [`TRef`](object::TRef) and [`Ref`](object::Ref). |
| 36 | +//! Bare references to API types, like `&'a Node`, represent valid and safe references to Godot objects. |
35 | 37 | //! As such, API methods may be called safely on them. `TRef` adds typestate tracking, which
|
36 | 38 | //! enable additional abilities like being able to be passed to the engine. `Ref`, or
|
37 |
| -//! "persistent" references, have `'static` lifetime, but are not always safe to use. For more |
38 |
| -//! information on how to use persistent references safely, see the type-level documentation |
39 |
| -//! on `Ref`. |
| 39 | +//! _persistent_ references, have `'static` lifetime, but are not always safe to use. For more |
| 40 | +//! information on how to use persistent references safely, see the [`object`] module documentation |
| 41 | +//! or the corresponding [book chapter][gdnative-overview]. |
40 | 42 | //!
|
41 | 43 | //! ## Feature flags
|
42 | 44 | //! All features are disabled by default.
|
|
59 | 61 | //! 3. If neither of the above is found, an error is generated.
|
60 | 62 | //!
|
61 | 63 | //! The symbols in [`api`] will be generated in a way compatible with that engine version.
|
62 |
| -//! This allows to use Godot versions older than the currently supported ones. Note that there |
63 |
| -//! are some bugs for Godot versions prior to 3.3.1. |
| 64 | +//! This allows to use Godot versions older than the currently supported ones. |
64 | 65 | //!
|
65 | 66 | //! See [Custom Godot builds][custom-godot] for detailed instructions.
|
66 | 67 | //!
|
|
69 | 70 | //! into multiple files. This can also help IDEs that struggle with a single huge file.
|
70 | 71 | //!
|
71 | 72 | //! [thread-safety]: https://docs.godotengine.org/en/stable/tutorials/threads/thread_safe_apis.html
|
| 73 | +//! [gdnative-overview]: https://godot-rust.github.io/book/gdnative-overview.html |
72 | 74 | //! [custom-godot]: https://godot-rust.github.io/book/advanced-guides/custom-godot.html
|
73 | 75 | //!
|
74 | 76 | //!
|
|
0 commit comments