Trait godot::builtin::RustCallable
pub trait RustCallable: 'static + PartialEq + Hash + Display + Send + Sync {
// Required method
fn invoke(&mut self, args: &[&Variant]) -> Result<Variant, ()>;
}
Expand description
Represents a custom callable object defined in Rust.
This trait has a single method, invoke
, which is called upon invocation.
Since callables can be invoked from anywhere, they must be self-contained ('static
) and thread-safe (Send + Sync
).
They also should implement Display
for the Godot string representation.
Furthermore, PartialEq
and Hash
are required for equality checks and usage as a key in a Dictionary
.
Required Methods§
Object Safety§
This trait is not object safe.