Trait GodotClass

Source
pub trait GodotClass: Bounds + 'static
where Self: Sized,
{ type Base: GodotClass; const INIT_LEVEL: InitLevel = <Self::Base as GodotClass>::INIT_LEVEL; // Required method fn class_name() -> ClassName; // Provided method fn inherits<U: GodotClass>() -> bool { ... } }
Expand description

Makes T eligible to be managed by Godot and stored in Gd<T> pointers.

The behavior of types implementing this trait is influenced by the associated types; check their documentation for information.

Normally, you don’t need to implement this trait yourself; use #[derive(GodotClass)] instead.

Provided Associated Constants§

Source

const INIT_LEVEL: InitLevel = <Self::Base as GodotClass>::INIT_LEVEL

Initialization level, during which this class should be initialized with Godot.

The default is a good choice in most cases; override only if you have very specific initialization requirements. It must not be less than Base::INIT_LEVEL.

Required Associated Types§

Source

type Base: GodotClass

The immediate superclass of T. This is always a Godot engine class.

Required Methods§

Source

fn class_name() -> ClassName

The name of the class, under which it is registered in Godot.

This may deviate from the Rust struct name: HttpRequest::class_name().as_str() == "HTTPRequest".

Provided Methods§

Source

fn inherits<U: GodotClass>() -> bool

Returns whether Self inherits from U.

This is reflexive, i.e Self inherits from itself.

See also Inherits for a trait bound.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl GodotClass for NoBase

Source§

const INIT_LEVEL: InitLevel = InitLevel::Core

Source§

type Base = NoBase

Source§

impl GodotClass for ArrayMesh

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Mesh

Source§

impl GodotClass for CanvasItem

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Node

Source§

impl GodotClass for ClassDb

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for EditorExportPlugin

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Editor

Source§

type Base = RefCounted

Source§

impl GodotClass for EditorPlugin

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Editor

Source§

type Base = Node

Source§

impl GodotClass for Engine

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for FileAccess

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = RefCounted

Source§

impl GodotClass for GDScript

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Script

Source§

impl GodotClass for HttpRequest

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Node

Source§

impl GodotClass for Input

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for InputEvent

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Resource

Source§

impl GodotClass for InputEventAction

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = InputEvent

Source§

impl GodotClass for MainLoop

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for Mesh

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Resource

Source§

impl GodotClass for Node2D

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = CanvasItem

Source§

impl GodotClass for Node3D

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Node

Source§

impl GodotClass for Node

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for Object

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Servers

Source§

type Base = NoBase

Source§

impl GodotClass for Os

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for PackedScene

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Resource

Source§

impl GodotClass for PrimitiveMesh

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Mesh

Source§

impl GodotClass for RefCounted

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for RenderingServer

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Servers

Source§

type Base = Object

Source§

impl GodotClass for Resource

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = RefCounted

Source§

impl GodotClass for ResourceFormatLoader

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = RefCounted

Source§

impl GodotClass for ResourceLoader

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for ResourceSaver

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for SceneTree

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = MainLoop

Source§

impl GodotClass for Script

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Resource

Source§

impl GodotClass for ScriptExtension

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Script

Source§

impl GodotClass for ScriptLanguage

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for ScriptLanguageExtension

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = ScriptLanguage

Source§

impl GodotClass for Texture

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Resource

Source§

impl GodotClass for Time

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Object

Source§

impl GodotClass for Viewport

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Node

Source§

impl GodotClass for Window

Source§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Source§

type Base = Viewport