Skip to content

Commit e78f2bf

Browse files
committed
Minor lib.rs doc improvements
1 parent fe359eb commit e78f2bf

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

gdnative/src/lib.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
//! # Rust bindings for the Godot game engine
22
//!
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.
44
//! Some of the types were automatically generated from the engine's JSON API description,
55
//! and some other types are hand made wrappers around the core C types.
66
//!
7-
//! ## Memory management for core types
7+
//! ## Core types
88
//!
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
1314
//! [thread-safety guidelines][thread-safety]. For more information, read the type-level
1415
//! documentation for these types.
1516
//!
@@ -20,23 +21,24 @@
2021
//!
2122
//! ## Generated API types
2223
//!
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.
2729
//!
2830
//! ### Memory management
2931
//!
3032
//! API types may be reference-counted or manually-managed. This is indicated by the
3133
//! `RefCounted` and `ManuallyManaged` marker traits.
3234
//!
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.
3537
//! As such, API methods may be called safely on them. `TRef` adds typestate tracking, which
3638
//! 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].
4042
//!
4143
//! ## Feature flags
4244
//! All features are disabled by default.
@@ -59,8 +61,7 @@
5961
//! 3. If neither of the above is found, an error is generated.
6062
//!
6163
//! 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.
6465
//!
6566
//! See [Custom Godot builds][custom-godot] for detailed instructions.
6667
//!
@@ -69,6 +70,7 @@
6970
//! into multiple files. This can also help IDEs that struggle with a single huge file.
7071
//!
7172
//! [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
7274
//! [custom-godot]: https://godot-rust.github.io/book/advanced-guides/custom-godot.html
7375
//!
7476
//!

0 commit comments

Comments
 (0)