godot::obj::bounds

Macro implement_godot_bounds

macro_rules! implement_godot_bounds {
    ($UserClass:ty) => { ... };
}
Expand description

Implements Bounds for a user-defined class.

This is only necessary if you do not use the proc-macro API.

Since Bounds is a supertrait of GodotClass, you cannot accidentally forget to implement it.

ยงExample

use godot::prelude::*;
use godot::obj::bounds::implement_godot_bounds;
use godot::meta::ClassName;

struct MyClass {}

impl GodotClass for MyClass {
    type Base = Node;

    fn class_name() -> ClassName {
        ClassName::new_cached::<MyClass>(|| "MyClass".to_string())
    }
}

implement_godot_bounds!(MyClass);