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
impl EngineApi
Sourcepub fn builtins(&self) -> &[BuiltinData]
pub fn builtins(&self) -> &[BuiltinData]
All builtin Variant types.
Sourcepub fn builtin(&self, id: BuiltinId) -> &BuiltinData
pub fn builtin(&self, id: BuiltinId) -> &BuiltinData
The builtin type with the given id.
Sourcepub fn class_by_name(&self, name: &str) -> Option<ClassId>
pub fn class_by_name(&self, name: &str) -> Option<ClassId>
Resolve an engine class name to its id.
Sourcepub fn builtin_by_name(&self, name: &str) -> Option<BuiltinId>
pub fn builtin_by_name(&self, name: &str) -> Option<BuiltinId>
Resolve a builtin type name to its id.
Sourcepub fn int_builtin(&self) -> Option<BuiltinId>
pub fn int_builtin(&self) -> Option<BuiltinId>
The cached id of the int builtin.
Sourcepub fn singleton(&self, name: &str) -> Option<ClassId>
pub fn singleton(&self, name: &str) -> Option<ClassId>
Resolve a singleton symbol (Input, OS, …) to the class it is an instance of.
Sourcepub fn utility(&self, name: &str) -> Option<&UtilityFn>
pub fn utility(&self, name: &str) -> Option<&UtilityFn>
Look up a @GlobalScope utility function (sin, print, …).
Sourcepub fn global_enum(&self, name: &str) -> Option<&EnumInfo>
pub fn global_enum(&self, name: &str) -> Option<&EnumInfo>
Look up a global (@GlobalScope) enum (Error, Key, …).
Sourcepub fn global_const(&self, name: &str) -> Option<&GlobalConst>
pub fn global_const(&self, name: &str) -> Option<&GlobalConst>
Look up a hand-authored pseudo-constant (PI/TAU/INF/NAN).
Sourcepub fn gdscript_builtin(&self, name: &str) -> Option<&BuiltinFn>
pub fn gdscript_builtin(&self, name: &str) -> Option<&BuiltinFn>
Look up a hand-authored GDScript builtin function (preload/range/len/…).
Sourcepub fn lookup_member(&self, class: ClassId, name: &str) -> Option<MemberRef<'_>>
pub fn lookup_member(&self, class: ClassId, name: &str) -> Option<MemberRef<'_>>
Resolve name on class, walking the base chain; the nearest declarer wins.
Sourcepub fn is_subclass(&self, sub: ClassId, sup: ClassId) -> bool
pub fn is_subclass(&self, sub: ClassId, sup: ClassId) -> bool
Whether sub is sup or transitively inherits it.
Sourcepub fn members_of(&self, class: ClassId) -> Vec<MemberRef<'_>>
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).
Sourcepub fn builtin_member(
&self,
builtin: BuiltinId,
name: &str,
) -> Option<&BuiltinMember>
pub fn builtin_member( &self, builtin: BuiltinId, name: &str, ) -> Option<&BuiltinMember>
A field of a builtin type (Vector2.x).
Sourcepub fn builtin_method(
&self,
builtin: BuiltinId,
name: &str,
) -> Option<&MethodSig>
pub fn builtin_method( &self, builtin: BuiltinId, name: &str, ) -> Option<&MethodSig>
A method of a builtin type (Array.size).
Sourcepub fn builtin_operators(&self, builtin: BuiltinId) -> &[OperatorSig]
pub fn builtin_operators(&self, builtin: BuiltinId) -> &[OperatorSig]
The operator overloads of a builtin type (the caller matches op + RHS).
Source§impl EngineApi
impl EngineApi
Sourcepub fn from_data(data: ApiData) -> Self
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.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, LoadError>
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.
Sourcepub fn version(&self) -> &ApiVersion
pub fn version(&self) -> &ApiVersion
The Godot version this model was generated from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EngineApi
impl RefUnwindSafe for EngineApi
impl Send for EngineApi
impl Sync for EngineApi
impl Unpin for EngineApi
impl UnsafeUnpin for EngineApi
impl UnwindSafe for EngineApi
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.