Smaller API changes collected in one issue:
-
IAudioStream::instantiate_playback(&self) -> (&mut self)
-
GDExtensionManager API should be mostly unsafe
-
We have AnyDictionary::cast_dictionary but no AnyArray::cast_array.
- Either add or remove both. Also needs ⚠️ sign.
-
Gd::is_dynamic_class_of::<T> could get T: Inherits<Self> bound, to rule out impossible checks at compile time.
- Possibly also see if there's a difference to
gd.try_cast::<T>().is_ok() and if yes, document it; if no, see if method is still useful.
-
ClassId can implement GodotStringExt in favor of inherent methods.
-
Consider #[non_exhaustive] for some enums
InitLevel (InitStage already has it)
-
global module type safety + organization.
Make sure to mention in mapping list on top of global module and to create #[doc(alias)] (also for existing map entries).
type_convert should take VariantType instead of i64. Maybe consider move to Variant::to_dynamic_or_default() or so?
rid_allocate_id should return Rid or potentially be associated fn on Rid type.
error_string should be moved to Error
hash -- move to Variant? Has already hash_u32, is this the same?
rid_from_int64 -- move to Rid?
typeof_ -- remove; already present as Variant::get_type.
rand_from_seed() -- PackedArray<i64> but always 2 elements, could be tuple
-
Rename global::Error -> global::GError (too generic of a name, also with Rust's Error trait)
-
Node::notify_thread_safe should have same signature as notify
- or consider unified
notify_ex with reversed + thread_safe flags (mutually exclusive?)
- similar:
Node::propagate_notification
-
OS::is_keycode_unicode(u32) -> Key parameter
-
Several APIs could use InstanceId
PhysicsServer2D::area_attach_object_instance_id(..., id: u64)
PhysicsServer2D::area_get_object_instance_id(...) -> u64
PhysicsServer2D::body_attach_object_instance_id(...)
PhysicsServer3D::body_attach_object_instance_id(...)
KinematicCollision2D::get_collider_id() -> u64
KinematicCollision3D::get_collider_id() -> u64
APIs that are not nice, but changing has perf impacts (array copies):
-
IP::get_resolve_item_addresses() -> Array<Variant>
- could be
PackedStringArray, like get_local_addresses
-
EditorExportPlatform::get_current_presets() -> Array<Variant>
Smaller API changes collected in one issue:
IAudioStream::instantiate_playback(&self)->(&mut self)GDExtensionManagerAPI should be mostly unsafeWe have
AnyDictionary::cast_dictionarybut noAnyArray::cast_array.Gd::is_dynamic_class_of::<T>could getT: Inherits<Self>bound, to rule out impossible checks at compile time.gd.try_cast::<T>().is_ok()and if yes, document it; if no, see if method is still useful.ClassIdcan implementGodotStringExtin favor of inherent methods.Consider
#[non_exhaustive]for some enumsInitLevel(InitStagealready has it)globalmodule type safety + organization.Make sure to mention in mapping list on top of
globalmodule and to create#[doc(alias)](also for existing map entries).type_convertshould takeVariantTypeinstead ofi64. Maybe consider move toVariant::to_dynamic_or_default()or so?rid_allocate_idshould returnRidor potentially be associated fn onRidtype.error_stringshould be moved toErrorhash-- move toVariant? Has alreadyhash_u32, is this the same?rid_from_int64-- move toRid?typeof_-- remove; already present asVariant::get_type.rand_from_seed()--PackedArray<i64>but always 2 elements, could be tupleRename
global::Error->global::GError(too generic of a name, also with Rust'sErrortrait)Node::notify_thread_safeshould have same signature asnotifynotify_exwithreversed+thread_safeflags (mutually exclusive?)Node::propagate_notificationOS::is_keycode_unicode(u32)->KeyparameterSeveral APIs could use
InstanceIdAPIs that are not nice, but changing has perf impacts (array copies):
IP::get_resolve_item_addresses() -> Array<Variant>PackedStringArray, likeget_local_addressesEditorExportPlatform::get_current_presets() -> Array<Variant>