Macro godot::obj::bounds::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::builtin::meta::ClassName;

struct MyClass {}

impl GodotClass for MyClass {
    type Base = Node;

    fn class_name() -> ClassName {
        ClassName::from_ascii_cstr(b"MyClass\0")
    }
}

implement_godot_bounds!(MyClass);