Trait Bounds

Source
pub unsafe trait Bounds {
    type Memory: Memory;
    type Declarer: Declarer;
}
Expand description

Library-implemented trait to check bounds on GodotClass types.

See bounds module for how to use this for bounds checking.

§No manual impl

Never implement this trait manually.

Most of the time, this trait is covered by #[derive(GodotClass)]. If you implement GodotClass manually, use the implement_godot_bounds! macro.

There are two reasons to avoid a handwritten impl Bounds:

  • The trait is unsafe and it is very easy to get internal bounds wrong. This will lead to immediate UB.
  • Apart from the documented members, the trait may have undocumented items that may be broken at any time and stand under no SemVer guarantees.

§Safety

Internal. The library implements this trait and ensures safety.

Required Associated Types§

Source

type Memory: Memory

Defines the memory strategy of the static type.

Source

type Declarer: Declarer

Whether this class is a core Godot class provided by the engine, or declared by the user as a Rust struct.

Implementors§

Source§

impl Bounds for NoBase

Source§

impl Bounds for ArrayMesh

Source§

impl Bounds for CanvasItem

Source§

impl Bounds for ClassDb

Source§

impl Bounds for EditorExportPlugin

Source§

impl Bounds for EditorPlugin

Source§

impl Bounds for Engine

Source§

impl Bounds for FileAccess

Source§

impl Bounds for GDScript

Source§

impl Bounds for HttpRequest

Source§

impl Bounds for Input

Source§

impl Bounds for InputEvent

Source§

impl Bounds for InputEventAction

Source§

impl Bounds for MainLoop

Source§

impl Bounds for Mesh

Source§

impl Bounds for Node2D

Source§

impl Bounds for Node3D

Source§

impl Bounds for Node

Source§

impl Bounds for Object

Source§

impl Bounds for Os

Source§

impl Bounds for PackedScene

Source§

impl Bounds for PrimitiveMesh

Source§

impl Bounds for RefCounted

Source§

impl Bounds for RenderingServer

Source§

impl Bounds for Resource

Source§

impl Bounds for ResourceFormatLoader

Source§

impl Bounds for ResourceLoader

Source§

impl Bounds for ResourceSaver

Source§

impl Bounds for SceneTree

Source§

impl Bounds for Script

Source§

impl Bounds for ScriptExtension

Source§

impl Bounds for ScriptLanguage

Source§

impl Bounds for ScriptLanguageExtension

Source§

impl Bounds for Texture

Source§

impl Bounds for Time

Source§

impl Bounds for Viewport

Source§

impl Bounds for Window