We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ccd67dc commit bc802b8Copy full SHA for bc802b8
godot-core/src/obj/instance_id.rs
@@ -58,6 +58,14 @@ impl InstanceId {
58
self.to_u64() & (1u64 << 63) != 0
59
}
60
61
+ /// Dynamically checks if the instance behind the ID exists.
62
+ ///
63
+ /// Rather slow, involves engine round-trip plus object DB lookup. If you need the object, use
64
+ /// [`Gd::from_instance_id()`][crate::obj::Gd::from_instance_id] instead.
65
+ pub fn lookup_validity(self) -> bool {
66
+ crate::gen::utilities::is_instance_id_valid(self.to_i64())
67
+ }
68
+
69
// Private: see rationale above
70
pub(crate) fn to_u64(self) -> u64 {
71
self.value.get()
0 commit comments