Skip to content

Commit 083393e

Browse files
committed
TypedArray: mention use cases and limitations in doc
1 parent e08ee8c commit 083393e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gdnative-core/src/core_types/typed_array.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ use crate::NewRef;
1414
/// A reference-counted CoW typed vector using Godot's pool allocator, generic over possible
1515
/// element types.
1616
///
17+
/// `TypedArray` unifies all the different `Pool*Array` types exported by Godot. It can be used
18+
/// in exported Rust methods as parameter and return types, as well as in exported properties.
19+
/// However, it is limited to the element types, for which a `Pool*Array` exists in GDScript,
20+
/// i.e. it cannot contain user-defined types.
21+
/// If you need other types, look into [`VariantArray`](struct.VariantArray.html) or directly use
22+
/// `Vec<T>` for type safety.
23+
///
1724
/// This type is CoW. The `Clone` implementation of this type creates a new reference without
1825
/// copying the contents.
1926
///

0 commit comments

Comments
 (0)