Skip to content

Commit 13bab10

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

File tree

7 files changed

+25
-17
lines changed

7 files changed

+25
-17
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/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/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/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,6 @@ pub use init::{InitializeInfo, TerminateInfo};
5959
pub use new_ref::NewRef;
6060
pub use object::{GodotObject, Null, Ref, TRef};
6161

62-
pub type GodotResult = Result<(), core_types::error::GodotError>;
62+
#[deprecated(since = "0.10", note = "use core_types::GodotResult")]
63+
#[doc(hidden)]
64+
pub type GodotResult = core_types::GodotResult;

gdnative/src/prelude.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
pub use gdnative_core::core_types::{
2-
self, error::GodotError, Aabb, Basis, ByteArray, Color, ColorArray, Dictionary, Float32Array,
2+
self, GodotError, Aabb, Basis, ByteArray, Color, ColorArray, Dictionary, Float32Array,
33
GodotString, Int32Array, NodePath, Plane, Quat, Rect2, Rid, StringArray, StringName, Transform,
44
Transform2D, TypedArray, Variant, VariantArray, VariantDispatch, VariantOperator, VariantType,
55
Vector2, Vector2Array, Vector3, Vector3Array,
66
};
7+
78
pub use gdnative_core::core_types::{
89
FromVariant, FromVariantError, OwnedToVariant, ToVariant, ToVariantEq,
910
};
1011

1112
pub use gdnative_core::object::{
1213
AsArg, GodotObject, Instanciable, Null, QueueFree, Ref, SubClass, TRef,
1314
};
15+
1416
pub use gdnative_core::ref_kind::{ManuallyManaged, RefCounted};
1517
pub use gdnative_core::thread_access::{Shared, ThreadLocal, Unique};
1618
pub use gdnative_core::NewRef;

test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub extern "C" fn run_tests(
2121
let mut status = true;
2222
status &= gdnative::core_types::test_string();
2323

24-
status &= gdnative::core_types::dictionary::test_dictionary();
24+
status &= gdnative::core_types::test_dictionary();
2525
// status &= gdnative::test_dictionary_clone_clear();
2626
status &= gdnative::core_types::test_color();
2727
status &= gdnative::core_types::test_array();

0 commit comments

Comments
 (0)