@@ -12,7 +12,7 @@ use crate::private::get_api;
1212/// A reference-counted CoW typed vector using Godot's pool allocator, generic over possible
1313/// element types.
1414///
15- /// `TypedArray ` unifies all the different `Pool*Array` types exported by Godot. It can be used
15+ /// `PoolArray ` unifies all the different `Pool*Array` types exported by Godot. It can be used
1616/// in exported Rust methods as parameter and return types, as well as in exported properties.
1717/// However, it is limited to the element types, for which a `Pool*Array` exists in GDScript,
1818/// i.e. it cannot contain user-defined types.
@@ -25,7 +25,7 @@ use crate::private::get_api;
2525/// When using this type, it's generally better to perform mutations in batch using `write`,
2626/// or the `append` methods, as opposed to `push` or `set`, because the latter ones trigger
2727/// CoW behavior each time they are called.
28- pub struct TypedArray < T : Element > {
28+ pub struct PoolArray < T : Element > {
2929 inner : T :: SysArray ,
3030}
3131
@@ -36,7 +36,7 @@ pub type Read<'a, T> = Aligned<ReadGuard<'a, T>>;
3636/// as opposed to every time with methods like `push`.
3737pub type Write < ' a , T > = Aligned < WriteGuard < ' a , T > > ;
3838
39- impl < T : Element > Drop for TypedArray < T > {
39+ impl < T : Element > Drop for PoolArray < T > {
4040 #[ inline]
4141 fn drop ( & mut self ) {
4242 unsafe {
@@ -45,47 +45,47 @@ impl<T: Element> Drop for TypedArray<T> {
4545 }
4646}
4747
48- impl < T : Element > Default for TypedArray < T > {
48+ impl < T : Element > Default for PoolArray < T > {
4949 #[ inline]
5050 fn default ( ) -> Self {
51- TypedArray :: new ( )
51+ PoolArray :: new ( )
5252 }
5353}
5454
55- impl < T : Element + fmt:: Debug > fmt:: Debug for TypedArray < T > {
55+ impl < T : Element + fmt:: Debug > fmt:: Debug for PoolArray < T > {
5656 #[ inline]
5757 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
5858 f. debug_list ( ) . entries ( self . read ( ) . iter ( ) ) . finish ( )
5959 }
6060}
6161
62- impl < T : Element > Clone for TypedArray < T > {
62+ impl < T : Element > Clone for PoolArray < T > {
6363 #[ inline]
6464 fn clone ( & self ) -> Self {
6565 self . new_ref ( )
6666 }
6767}
6868
69- impl < T : Element > NewRef for TypedArray < T > {
69+ impl < T : Element > NewRef for PoolArray < T > {
7070 /// Creates a new reference to this reference-counted instance.
7171 #[ inline]
7272 fn new_ref ( & self ) -> Self {
7373 unsafe {
7474 let mut inner = T :: SysArray :: default ( ) ;
7575 ( T :: new_copy_fn ( get_api ( ) ) ) ( & mut inner, self . sys ( ) ) ;
76- TypedArray { inner }
76+ PoolArray { inner }
7777 }
7878 }
7979}
8080
81- impl < T : Element > TypedArray < T > {
81+ impl < T : Element > PoolArray < T > {
8282 /// Creates an empty array.
8383 #[ inline]
8484 pub fn new ( ) -> Self {
8585 unsafe {
8686 let mut inner = T :: SysArray :: default ( ) ;
8787 ( T :: new_fn ( get_api ( ) ) ) ( & mut inner) ;
88- TypedArray { inner }
88+ PoolArray { inner }
8989 }
9090 }
9191
@@ -95,11 +95,11 @@ impl<T: Element> TypedArray<T> {
9595 unsafe {
9696 let mut inner = T :: SysArray :: default ( ) ;
9797 ( T :: new_with_array_fn ( get_api ( ) ) ) ( & mut inner, array. sys ( ) ) ;
98- TypedArray { inner }
98+ PoolArray { inner }
9999 }
100100 }
101101
102- /// Creates a `TypedArray ` moving elements from `src`.
102+ /// Creates a `PoolArray ` moving elements from `src`.
103103 #[ inline]
104104 pub fn from_vec ( mut src : Vec < T > ) -> Self {
105105 let mut arr = Self :: new ( ) ;
@@ -261,12 +261,12 @@ impl<T: Element> TypedArray<T> {
261261 #[ doc( hidden) ]
262262 #[ inline]
263263 pub fn from_sys ( sys : T :: SysArray ) -> Self {
264- TypedArray { inner : sys }
264+ PoolArray { inner : sys }
265265 }
266266}
267267
268- impl < T : Element + Copy > TypedArray < T > {
269- /// Creates a new `TypedArray ` by copying from `src`.
268+ impl < T : Element + Copy > PoolArray < T > {
269+ /// Creates a new `PoolArray ` by copying from `src`.
270270 ///
271271 /// # Panics
272272 ///
@@ -297,23 +297,23 @@ impl<T: Element + Copy> TypedArray<T> {
297297// `FromIterator` and `Extend` implementations collect into `Vec` first, because Rust `Vec`s
298298// are better at handling unknown lengths than the Godot arrays (`push` CoWs every time!)
299299
300- impl < T : Element > FromIterator < T > for TypedArray < T > {
300+ impl < T : Element > FromIterator < T > for PoolArray < T > {
301301 #[ inline]
302302 fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> Self {
303303 let vec = iter. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
304304 Self :: from_vec ( vec)
305305 }
306306}
307307
308- impl < T : Element > Extend < T > for TypedArray < T > {
308+ impl < T : Element > Extend < T > for PoolArray < T > {
309309 #[ inline]
310310 fn extend < I : IntoIterator < Item = T > > ( & mut self , iter : I ) {
311311 let mut vec = iter. into_iter ( ) . collect :: < Vec < _ > > ( ) ;
312312 self . append_vec ( & mut vec) ;
313313 }
314314}
315315
316- impl < T : Element + PartialEq > PartialEq for TypedArray < T > {
316+ impl < T : Element + PartialEq > PartialEq for PoolArray < T > {
317317 #[ inline]
318318 fn eq ( & self , other : & Self ) -> bool {
319319 if self . len ( ) != other. len ( ) {
@@ -326,7 +326,7 @@ impl<T: Element + PartialEq> PartialEq for TypedArray<T> {
326326 left. as_slice ( ) == right. as_slice ( )
327327 }
328328}
329- impl < T : Element + Eq > Eq for TypedArray < T > { }
329+ impl < T : Element + Eq > Eq for PoolArray < T > { }
330330
331331/// RAII read guard.
332332pub struct ReadGuard < ' a , T : Element > {
@@ -437,7 +437,7 @@ impl<'a, T: Element> Drop for WriteGuard<'a, T> {
437437}
438438
439439macros:: decl_typed_array_element! {
440- /// Trait for element types that can be contained in `TypedArray `. This trait is sealed
440+ /// Trait for element types that can be contained in `PoolArray `. This trait is sealed
441441 /// and has no public interface.
442442 pub trait Element : private:: Sealed { .. }
443443}
@@ -495,7 +495,7 @@ mod serialize {
495495 use std:: fmt:: Formatter ;
496496 use std:: marker:: PhantomData ;
497497
498- impl < T : Serialize + Element > Serialize for TypedArray < T > {
498+ impl < T : Serialize + Element > Serialize for PoolArray < T > {
499499 #[ inline]
500500 fn serialize < S > ( & self , ser : S ) -> Result < <S as Serializer >:: Ok , <S as Serializer >:: Error >
501501 where
@@ -510,15 +510,15 @@ mod serialize {
510510 }
511511 }
512512
513- impl < ' de , T : Deserialize < ' de > + Element > Deserialize < ' de > for TypedArray < T > {
513+ impl < ' de , T : Deserialize < ' de > + Element > Deserialize < ' de > for PoolArray < T > {
514514 #[ inline]
515515 fn deserialize < D > ( deserializer : D ) -> Result < Self , <D as Deserializer < ' de > >:: Error >
516516 where
517517 D : Deserializer < ' de > ,
518518 {
519519 struct TypedArrayVisitor < T > ( PhantomData < T > ) ;
520520 impl < ' de , T : Deserialize < ' de > + Element > Visitor < ' de > for TypedArrayVisitor < T > {
521- type Value = TypedArray < T > ;
521+ type Value = PoolArray < T > ;
522522
523523 fn expecting ( & self , formatter : & mut Formatter ) -> fmt:: Result {
524524 formatter. write_str ( std:: any:: type_name :: < Self :: Value > ( ) )
0 commit comments