Skip to main content

App

Struct App 

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

Runnable ECS host pairing one World with one compiled Schedule.

Implementations§

Source§

impl App

Source

pub fn builder() -> AppBuilder

Starts checked construction with a standard schedule template.

Source

pub fn from_parts(world: World, schedule: Schedule) -> Result<Self, BuildError>

Assembles an application from an already-built world and schedule.

Rejects pending commands, active run guards, poisoned mutation state, and lease mismatch.

Source

pub fn world(&self) -> &World

Read-only access to the owned world.

Source

pub fn world_mut(&mut self) -> &mut World

Mutable world access between passes when the app is not faulted.

Source

pub fn schedule(&self) -> &Schedule

Read-only access to the compiled schedule graph.

Source

pub fn is_faulted(&self) -> bool

Whether a terminal fault prevents further execution.

Source

pub fn fault(&self) -> Option<&AppFault>

Returns the first terminal fault retained by this application.

Source

pub fn set_system_enabled( &mut self, id: &SystemId, enabled: bool, ) -> Result<(), ScheduleError>

Enables or disables one compiled system without rebuilding the schedule.

Source

pub fn update(&mut self, delta_seconds: f32) -> Result<(), AppError>

Runs the full Update pass for delta_seconds.

Source

pub fn update_plan( &mut self, delta_seconds: f32, plan: &UpdatePlan, ) -> Result<(), AppError>

Runs a validated subset of Update stages.

Startup still runs once before the first successful planned update. The selected stages retain compiled order, share one world tick, final flush, and Update-frame event cleanup.

Source

pub fn update_with<R>( &mut self, delta_seconds: f32, observe: impl FnOnce(&World) -> R, ) -> Result<R, AppError>

Runs Update and returns a value observed from the world after frame cleanup.

Source

pub fn render(&mut self, delta_seconds: f32) -> Result<(), AppError>

Runs the Render pass for delta_seconds.

Source

pub fn render_with<R>( &mut self, delta_seconds: f32, observe: impl FnOnce(&World) -> R, ) -> Result<R, AppError>

Runs Render and returns a value observed from the world after frame cleanup.

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl !UnwindSafe for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

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> 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, 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.