Enum InitStage
#[non_exhaustive]pub enum InitStage {
Core,
Servers,
Scene,
Editor,
MainLoop,
}Expand description
Extended initialization stage that includes both initialization levels and the main loop.
This enum extends InitLevel with a MainLoop variant, representing the fully initialized state of Godot
after all initialization levels have been loaded and before any deinitialization begins.
During initialization, stages are loaded in order: Core → Servers → Scene → Editor (if in editor) → MainLoop.
During deinitialization, stages are unloaded in reverse order.
See also:
InitLevel: only levels, withoutMainLoop.ExtensionLibrary::on_stage_init()ExtensionLibrary::on_stage_deinit()ExtensionLibrary::on_main_loop_frame()
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Core
First level loaded by Godot. Builtin types are available, classes are not.
Servers
Second level loaded by Godot. Only server classes and builtins are available.
Scene
Third level loaded by Godot. Most classes are available.
Editor
Fourth level loaded by Godot, only in the editor. All classes are available.
MainLoop
since_api=4.5 only.The main loop stage, representing the fully initialized state of Godot.
This variant is only available in Godot 4.5+. In earlier versions, it will never be passed to callbacks.
Implementations§
§impl InitStage
impl InitStage
pub fn try_to_level(self) -> Option<InitLevel>
pub fn try_to_level(self) -> Option<InitLevel>
Try to convert this initialization stage to an initialization level.
Returns None for InitStage::MainLoop, as it doesn’t correspond to a Godot initialization level.