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.
Trait Implementations§
§impl Ord for InitStage
impl Ord for InitStage
§impl PartialOrd for InitStage
impl PartialOrd for InitStage
impl Copy for InitStage
impl Eq for InitStage
impl StructuralPartialEq for InitStage
Auto Trait Implementations§
impl Freeze for InitStage
impl RefUnwindSafe for InitStage
impl Send for InitStage
impl Sync for InitStage
impl Unpin for InitStage
impl UnwindSafe for InitStage
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)