Skip to main content

EngineApi

Struct EngineApi 

Source
pub struct EngineApi { /* private fields */ }
Expand description

The loaded, indexed Godot engine model.

Holds the deserialized ApiData plus the name → id indices rebuilt at load (kept out of the blob so the archived form stays portable — Playbook §4.5) and the hand-authored GDScript layer (pseudo-constants + builtin functions).

Implementations§

Source§

impl EngineApi

Source

pub fn classes(&self) -> &[ClassData]

All engine classes (extension_api.json order).

Source

pub fn builtins(&self) -> &[BuiltinData]

All builtin Variant types.

Source

pub fn class(&self, id: ClassId) -> &ClassData

The class with the given id.

Source

pub fn builtin(&self, id: BuiltinId) -> &BuiltinData

The builtin type with the given id.

Source

pub fn class_by_name(&self, name: &str) -> Option<ClassId>

Resolve an engine class name to its id.

Source

pub fn builtin_by_name(&self, name: &str) -> Option<BuiltinId>

Resolve a builtin type name to its id.

Source

pub fn int_builtin(&self) -> Option<BuiltinId>

The cached id of the int builtin.

Source

pub fn singleton(&self, name: &str) -> Option<ClassId>

Resolve a singleton symbol (Input, OS, …) to the class it is an instance of.

Source

pub fn utility(&self, name: &str) -> Option<&UtilityFn>

Look up a @GlobalScope utility function (sin, print, …).

Source

pub fn global_enum(&self, name: &str) -> Option<&EnumInfo>

Look up a global (@GlobalScope) enum (Error, Key, …).

Source

pub fn global_const(&self, name: &str) -> Option<&GlobalConst>

Look up a hand-authored pseudo-constant (PI/TAU/INF/NAN).

Source

pub fn gdscript_builtin(&self, name: &str) -> Option<&BuiltinFn>

Look up a hand-authored GDScript builtin function (preload/range/len/…).

Source

pub fn lookup_member(&self, class: ClassId, name: &str) -> Option<MemberRef<'_>>

Resolve name on class, walking the base chain; the nearest declarer wins.

Source

pub fn is_subclass(&self, sub: ClassId, sup: ClassId) -> bool

Whether sub is sup or transitively inherits it.

Source

pub fn members_of(&self, class: ClassId) -> Vec<MemberRef<'_>>

Every member visible on class including inherited ones, deduped with the nearest declarer winning — the candidate set for recv.<TAB> completion (Playbook §4.3).

Source

pub fn builtin_member( &self, builtin: BuiltinId, name: &str, ) -> Option<&BuiltinMember>

A field of a builtin type (Vector2.x).

Source

pub fn builtin_method( &self, builtin: BuiltinId, name: &str, ) -> Option<&MethodSig>

A method of a builtin type (Array.size).

Source

pub fn builtin_operators(&self, builtin: BuiltinId) -> &[OperatorSig]

The operator overloads of a builtin type (the caller matches op + RHS).

Source§

impl EngineApi

Source

pub fn from_data(data: ApiData) -> Self

Build the indexed model from a freshly decoded ApiData, rebuilding the name indices and merging the hand-authored GDScript layer.

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, LoadError>

Decode and index an engine-API blob produced by xtask codegen-api.

The bytes are copied into a 16-byte-aligned buffer before validation so a misaligned source (e.g. include_bytes! or a fetch()ed ArrayBuffer) decodes correctly.

§Errors

Returns LoadError::Decode if the blob fails rkyv validation.

Source

pub fn version(&self) -> &ApiVersion

The Godot version this model was generated from.

Trait Implementations§

Source§

impl Debug for EngineApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.