Skip to content

Commit e83dd6a

Browse files
committed
No longer export intermediate modules in core_types
1 parent 976ca46 commit e83dd6a

File tree

14 files changed

+32
-24
lines changed

14 files changed

+32
-24
lines changed

bindings_generator/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl Ty {
422422
Ty::Bool => syn::parse_quote! { bool },
423423
Ty::Vector2 => syn::parse_quote! { Vector2 },
424424
Ty::Vector3 => syn::parse_quote! { Vector3 },
425-
Ty::Vector3Axis => syn::parse_quote! { vector3::Axis },
425+
Ty::Vector3Axis => syn::parse_quote! { Axis },
426426
Ty::Quat => syn::parse_quote! { Quat },
427427
Ty::Transform => syn::parse_quote! { Transform },
428428
Ty::Transform2D => syn::parse_quote! { Transform2D },

gdnative-core/src/core_types/access.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ use std::ops::{Deref, DerefMut};
55
use std::ptr;
66
use std::slice;
77

8+
/// A pool array access that may be unaligned.
89
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
9-
/// An pool array access that may be unaligned.
1010
pub struct MaybeUnaligned<G> {
1111
guard: G,
1212
}
1313

14+
/// A pool array access that is (assumed to be) aligned.
1415
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
15-
/// An pool array access that is (assumed to be) aligned.
1616
pub struct Aligned<G> {
1717
guard: G,
1818
}
1919

20-
#[derive(Debug)]
21-
/// An pool array write access with an owned aligned copy. The data is written back when this is
20+
/// A pool array write access with an owned aligned copy. The data is written back when this is
2221
/// dropped.
22+
#[derive(Debug)]
2323
pub struct Owned<G>
2424
where
2525
G: Guard + WritePtr,

gdnative-core/src/core_types/byte_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::core_types::typed_array::TypedArray;
1+
use crate::core_types::TypedArray;
22

33
/// A reference-counted vector of `u8` that uses Godot's pool allocator.
44
pub type ByteArray = TypedArray<u8>;

gdnative-core/src/core_types/color_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::core_types::typed_array::TypedArray;
21
use crate::core_types::Color;
2+
use crate::core_types::TypedArray;
33

44
/// A reference-counted vector of `Color` that uses Godot's pool allocator.
55
pub type ColorArray = TypedArray<Color>;

gdnative-core/src/core_types/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ impl std::fmt::Display for GodotError {
8282
}
8383

8484
impl std::error::Error for GodotError {}
85+
86+
/// Result type with [GodotError]
87+
pub type GodotResult = Result<(), GodotError>;

gdnative-core/src/core_types/float32_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::core_types::typed_array::TypedArray;
1+
use crate::core_types::TypedArray;
22

33
/// A reference-counted vector of `f32` that uses Godot's pool allocator.
44
pub type Float32Array = TypedArray<f32>;

gdnative-core/src/core_types/int32_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::core_types::typed_array::TypedArray;
1+
use crate::core_types::TypedArray;
22

33
/// A reference-counted vector of `i32` that uses Godot's pool allocator.
44
pub type Int32Array = TypedArray<i32>;

gdnative-core/src/core_types/mod.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
//! Types that represent core-datatypes of Godot.
1+
//! Types that represent core data types of Godot.
2+
//!
3+
//! In contrast to generated Godot class types from the `api` module, the types in here are hand-written in idiomatic Rust and
4+
//! are the counterparts to built-in types in GDScript.
25
36
mod geom;
47

58
mod access;
69
mod byte_array;
710
mod color;
811
mod color_array;
12+
mod dictionary;
13+
mod error;
914
mod float32_array;
1015
mod int32_array;
1116
mod node_path;
@@ -20,21 +25,17 @@ mod variant;
2025
mod variant_array;
2126
mod vector2;
2227
mod vector2_array;
28+
mod vector3;
2329
mod vector3_array;
2430

25-
pub mod dictionary;
26-
pub mod error;
27-
pub mod vector3;
28-
29-
pub use geom::*;
30-
3131
pub use access::*;
3232
pub use byte_array::*;
3333
pub use color::*;
3434
pub use color_array::*;
35-
pub use dictionary::Dictionary;
36-
pub use error::GodotError;
35+
pub use dictionary::*;
36+
pub use error::{GodotError, GodotResult};
3737
pub use float32_array::*;
38+
pub use geom::*;
3839
pub use int32_array::*;
3940
pub use node_path::*;
4041
pub use quat::*;

gdnative-core/src/core_types/string_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::core_types::typed_array::TypedArray;
21
use crate::core_types::GodotString;
2+
use crate::core_types::TypedArray;
33

44
/// A reference-counted vector of `GodotString` that uses Godot's pool allocator.
55
pub type StringArray = TypedArray<GodotString>;

gdnative-core/src/core_types/vector2_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::core_types::typed_array::TypedArray;
1+
use crate::core_types::TypedArray;
22
use crate::core_types::Vector2;
33

44
/// A reference-counted vector of `Vector2` that uses Godot's pool allocator.

0 commit comments

Comments
 (0)