Trait godot_core::obj::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.

Required Associated Types§

source

type Base: GodotClass

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

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 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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl GodotClass for NoBase

§

type Base = NoBase

source§

const INIT_LEVEL: InitLevel = InitLevel::Core

source§

impl GodotClass for AnimatedSprite2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for Area2D

§

type Base = CollisionObject2D

source§

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

source§

impl GodotClass for ArrayMesh

§

type Base = Mesh

source§

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

source§

impl GodotClass for AudioStreamPlayer

§

type Base = Node

source§

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

source§

impl GodotClass for BaseButton

§

type Base = Control

source§

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

source§

impl GodotClass for BoxMesh

§

type Base = PrimitiveMesh

source§

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

source§

impl GodotClass for Button

§

type Base = BaseButton

source§

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

source§

impl GodotClass for Camera2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for Camera3D

§

type Base = Node3D

source§

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

source§

impl GodotClass for CanvasItem

§

type Base = Node

source§

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

source§

impl GodotClass for CanvasLayer

§

type Base = Node

source§

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

source§

impl GodotClass for ClassDb

§

type Base = Object

source§

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

source§

impl GodotClass for CollisionObject2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for CollisionShape2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for Control

§

type Base = CanvasItem

source§

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

source§

impl GodotClass for EditorPlugin

§

type Base = Node

source§

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

source§

impl GodotClass for Engine

§

type Base = Object

source§

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

source§

impl GodotClass for FileAccess

§

type Base = RefCounted

source§

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

source§

impl GodotClass for GDScript

§

type Base = Script

source§

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

source§

impl GodotClass for HttpRequest

§

type Base = Node

source§

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

source§

impl GodotClass for Image

§

type Base = Resource

source§

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

source§

impl GodotClass for ImageTextureLayered

§

type Base = TextureLayered

source§

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

source§

impl GodotClass for Input

§

type Base = Object

source§

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

source§

impl GodotClass for InputEvent

§

type Base = Resource

source§

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

source§

impl GodotClass for InputEventAction

§

type Base = InputEvent

source§

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

source§

impl GodotClass for Label

§

type Base = Control

source§

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

source§

impl GodotClass for MainLoop

§

type Base = Object

source§

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

source§

impl GodotClass for Marker2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for Mesh

§

type Base = Resource

source§

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

source§

impl GodotClass for Node2D

§

type Base = CanvasItem

source§

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

source§

impl GodotClass for Node3D

§

type Base = Node

source§

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

source§

impl GodotClass for Node3DGizmo

§

type Base = RefCounted

source§

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

source§

impl GodotClass for Node

§

type Base = Object

source§

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

source§

impl GodotClass for Object

§

type Base = NoBase

source§

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

source§

impl GodotClass for Os

§

type Base = Object

source§

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

source§

impl GodotClass for PackedScene

§

type Base = Resource

source§

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

source§

impl GodotClass for PathFollow2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for PhysicsBody2D

§

type Base = CollisionObject2D

source§

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

source§

impl GodotClass for PrimitiveMesh

§

type Base = Mesh

source§

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

source§

impl GodotClass for RefCounted

§

type Base = Object

source§

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

source§

impl GodotClass for RenderingServer

§

type Base = Object

source§

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

source§

impl GodotClass for Resource

§

type Base = RefCounted

source§

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

source§

impl GodotClass for ResourceFormatLoader

§

type Base = RefCounted

source§

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

source§

impl GodotClass for ResourceLoader

§

type Base = Object

source§

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

source§

impl GodotClass for ResourceSaver

§

type Base = Object

source§

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

source§

impl GodotClass for RigidBody2D

§

type Base = PhysicsBody2D

source§

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

source§

impl GodotClass for SceneTree

§

type Base = MainLoop

source§

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

source§

impl GodotClass for SceneTreeTimer

§

type Base = RefCounted

source§

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

source§

impl GodotClass for Script

§

type Base = Resource

source§

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

source§

impl GodotClass for ScriptExtension

§

type Base = Script

source§

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

source§

impl GodotClass for ScriptLanguage

§

type Base = Object

source§

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

source§

impl GodotClass for Sprite2D

§

type Base = Node2D

source§

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

source§

impl GodotClass for SpriteFrames

§

type Base = Resource

source§

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

source§

impl GodotClass for TextServer

§

type Base = RefCounted

source§

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

source§

impl GodotClass for TextServerExtension

§

type Base = TextServer

source§

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

source§

impl GodotClass for Texture2DArray

§

type Base = ImageTextureLayered

source§

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

source§

impl GodotClass for Texture

§

type Base = Resource

source§

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

source§

impl GodotClass for TextureLayered

§

type Base = Texture

source§

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

source§

impl GodotClass for Time

§

type Base = Object

source§

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

source§

impl GodotClass for Timer

§

type Base = Node

source§

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

source§

impl GodotClass for Viewport

§

type Base = Node

source§

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

source§

impl GodotClass for Window

§

type Base = Viewport

source§

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