pub struct App { /* private fields */ }Expand description
The application: a world plus the loop state that drives it.
Implementations§
Source§impl App
impl App
Sourcepub fn from_world(world: World) -> Self
pub fn from_world(world: World) -> Self
An app holding an already-built world, ready to start or run.
Sourcepub fn from_blob(path: &Path) -> Result<Self, CnResult>
pub fn from_blob(path: &Path) -> Result<Self, CnResult>
An app holding the world compiled into the blob file at path.
Overflow payload blobs are its siblings named by index, so a world
written to data/0 reads data/1, data/2, … beside it.
Anchors the state tree beside the blob unless a host already installed
one, so the settings and saves the app writes land with the world it
read rather than under the directory it was launched from. The world’s
own AppConfig.home overrides that at start.
Sourcepub fn load_blob(&mut self) -> Result<(), CnResult>
pub fn load_blob(&mut self) -> Result<(), CnResult>
load assets and blob payload data from the primary blob and populate the world. Replaces any previously loaded world
Sourcepub fn shutdown_token(&self) -> ShutdownToken
pub fn shutdown_token(&self) -> ShutdownToken
clone of the root cancellation token. Pass this to systems or the ctrl+c handler so they all share a single cancellation source
Sourcepub fn start(&mut self) -> Result<(), CnResult>
pub fn start(&mut self) -> Result<(), CnResult>
Build the world’s systems and run their init. Must run once, before
the first step.
Sourcepub fn load_world(&mut self, world: World)
pub fn load_world(&mut self, world: World)
Replace the current world and reset to Created so start() can be called again. Used to load a new scene at runtime.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for App
impl !RefUnwindSafe for App
impl !Sync for App
impl !UnwindSafe for App
impl Send for App
impl Unpin for App
impl UnsafeUnpin for App
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().