pub struct LazyWorld { /* private fields */ }Expand description
A resource used to gain safe access to the entire world.
LazyWorld exists in the world automatically and should be fetched as
Read<LazyWorld, NoDefault>.
This is used primarily from syncronous systems to spawn async actions but can also be used to alter anything inside the world.
Modifications made to the world through this resource are applied
in World::tick_lazy.
Implementations
sourceimpl LazyWorld
impl LazyWorld
sourcepub fn world_mut<T: Send + Sync + 'static>(
&self,
f: impl FnOnce(&mut World) -> T + Send + Sync + 'static
) -> Receiver<T>ⓘNotable traits for Receiver<T>impl<T> Future for Receiver<T> type Output = Result<T, Closed>;
pub fn world_mut<T: Send + Sync + 'static>(
&self,
f: impl FnOnce(&mut World) -> T + Send + Sync + 'static
) -> Receiver<T>ⓘNotable traits for Receiver<T>impl<T> Future for Receiver<T> type Output = Result<T, Closed>;
Conduct a mutation of the world.
Sends the result on a oneshot::Receiver<T> after completion.
Auto Trait Implementations
impl RefUnwindSafe for LazyWorld
impl Send for LazyWorld
impl Sync for LazyWorld
impl Unpin for LazyWorld
impl UnwindSafe for LazyWorld
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more