Struct edict::flow::FlowWorld

source ·
pub struct FlowWorld { /* private fields */ }
Expand description

World reference that is updated when flow is polled.

Implementations§

source§

impl FlowWorld

source

pub unsafe fn get<'a>(self) -> &'a mut WorldLocal

Returns reference to currently bound world.

It is easy to accidentally create aliasing references to the world. Prefer to use safe methods provided on this type to interact with the world.

If access to WorldLocal is required, consider using FlowWorld::poll first.

§Safety

Creates reference from raw pointer to WorldLocal bound to the flow context. Returned reference is unbound so it may outlive referenced world and become dangling. Creating more than one mutable reference to the world may also cause undefined behavior.

Note that many methods of FlowWorld or FlowEntity create temporary mutable references to the world.

So calling them while this reference is alive is not allowed.

source

pub fn map<F, R>(self, f: F) -> R
where F: FnOnce(&mut WorldLocal) -> R,

Access world reference with closure. Returns closure result.

Unlike FlowWorld::get this method is safe as it does not allow references to world to escape closure. And therefore references won’t able to outlive await boundaries.

Use FlowWorld::poll if you need to call poll closure until certain condition is met.

source

pub fn poll<F, R>(self, f: F) -> PollWorld<F>
where F: FnMut(&mut WorldLocal, &mut Context<'_>) -> Poll<R>,

Returns a future that will poll the closure with world reference. The future will resolve to closure result in Poll::Ready. The closure may use task context to register wakers.

source

pub fn poll_view<Q, F, R>(self, f: F) -> PollView<Q::Query, (), F>
where Q: DefaultQuery, F: FnMut(View<'_, Q>, &mut Context<'_>) -> Poll<R>,

Returns a future that will poll the closure with world view constructed with specified query type. The future will resolve to closure result in Poll::Ready. The closure may use task context to register wakers.

source

pub fn poll_view_filter<Q, F, Fun, R>( self, f: Fun, ) -> PollView<Q::Query, F::Query, Fun>
where Q: DefaultQuery, F: DefaultQuery + FnMut(View<'_, Q, F>, &mut Context<'_>) -> Poll<R>,

Returns a future that will poll the closure with world view constructed with specified query type and filter type. The future will resolve to closure result in Poll::Ready. The closure may use task context to register wakers.

source

pub fn poll_view_with<Q, F, R>( self, query: Q, f: F, ) -> PollView<Q::Query, (), F>
where Q: IntoQuery, F: FnMut(View<'_, Q>, &mut Context<'_>) -> Poll<R>,

Returns a future that will poll the closure with world view constructed with specified query. The future will resolve to closure result in Poll::Ready. The closure may use task context to register wakers.

source

pub fn poll_view_filter_with<Q, F, Fun, R>( self, query: Q, filter: F, f: Fun, ) -> PollView<Q::Query, F::Query, Fun>
where Q: IntoQuery, F: IntoQuery, Fun: FnMut(View<'_, Q, F>, &mut Context<'_>) -> Poll<R>,

Returns a future that will poll the closure with world view constructed with specified query and filter. The future will resolve to closure result in Poll::Ready. The closure may use task context to register wakers.

source

pub fn entity(self, entity: EntityId) -> Result<FlowEntity, NoSuchEntity>

Returns entity reference. Returns NoSuchEntity error if entity is not alive.

source

pub fn try_get_cloned<T>(self, entity: impl Entity) -> Result<T, EntityError>
where T: Clone + 'static,

Queries components from specified entity. Where query item is a reference to value the implements ToOwned. Returns item converted to owned value.

This method locks only archetype to which entity belongs for the duration of the method itself.

source

pub fn insert<T>( self, entity: impl Entity, component: T, ) -> Result<(), NoSuchEntity>
where T: Component,

Attempts to inserts component to the specified entity.

If entity already had component of that type, old component value is replaced with new one. Otherwise new component is added to the entity.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();

assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(false));
world.insert(entity, ExampleComponent).unwrap();
assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(true));
source

pub fn insert_external<T>( self, entity: impl Entity, component: T, ) -> Result<(), NoSuchEntity>
where T: 'static,

Attempts to inserts component to the specified entity.

If entity already had component of that type, old component value is replaced with new one. Otherwise new component is added to the entity.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();

assert_eq!(world.try_has_component::<u32>(entity), Ok(false));
world.ensure_external_registered::<u32>();
world.insert_external(entity, 42u32).unwrap();
assert_eq!(world.try_has_component::<u32>(entity), Ok(true));
source

pub fn with<T>( self, entity: impl Entity, f: impl FnOnce() -> T, ) -> Result<(), NoSuchEntity>
where T: Component,

Attempts to inserts component to the specified entity.

If entity already had component of that type, old component value is preserved. Otherwise new component is added to the entity.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();

assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(false));
world.with(entity, || ExampleComponent).unwrap();
assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(true));
source

pub fn with_external<T>( self, entity: impl Entity, f: impl FnOnce() -> T, ) -> Result<(), NoSuchEntity>
where T: 'static,

Attempts to inserts component to the specified entity.

If entity already had component of that type, old component value is preserved. Otherwise new component is added to the entity.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();

assert_eq!(world.try_has_component::<u32>(entity), Ok(false));
world.ensure_external_registered::<u32>();
world.with_external(entity, || 42u32).unwrap();
assert_eq!(world.try_has_component::<u32>(entity), Ok(true));
source

pub fn insert_bundle<B>( self, entity: impl Entity, bundle: B, ) -> Result<(), NoSuchEntity>

Inserts bundle of components to the specified entity. This is moral equivalent to calling World::insert with each component separately, but more efficient.

For each component type in bundle: If entity already had component of that type, old component value is replaced with new one. Otherwise new component is added to the entity.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();
assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(false));
world.insert_bundle(entity, (ExampleComponent,));
assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(true));
source

pub fn insert_external_bundle<B>( self, entity: impl Entity, bundle: B, ) -> Result<(), NoSuchEntity>
where B: DynamicBundle,

Inserts bundle of components to the specified entity. This is moral equivalent to calling World::insert with each component separately, but more efficient.

If entity has component of any type in bundle already, it is replaced with new one. Otherwise components is added to the entity.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();

assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(false));
assert_eq!(world.try_has_component::<u32>(entity), Ok(false));

world.ensure_component_registered::<ExampleComponent>();
world.ensure_external_registered::<u32>();

world.insert_external_bundle(entity, (ExampleComponent, 42u32));

assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(true));
assert_eq!(world.try_has_component::<u32>(entity), Ok(true));
source

pub fn with_bundle<B>( self, entity: impl Entity, bundle: B, ) -> Result<(), NoSuchEntity>

Inserts bundle of components to the specified entity. Adds only components missing from the entity. Components that are already present are not replaced, if replacing is required use FlowWorld::insert_bundle.

This function guarantees that no hooks are triggered, and entity cannot be despawned as a result of this operation.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();
assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(false));
world.insert_bundle(entity, (ExampleComponent,));
assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(true));
source

pub fn with_external_bundle<B>( self, entity: impl Entity, bundle: B, ) -> Result<(), NoSuchEntity>
where B: DynamicBundle,

Inserts bundle of components to the specified entity. Adds only components missing from the entity. Components that are already present are not replaced, if replacing is required use FlowWorld::insert_bundle.

If entity is not alive, fails with Err(NoSuchEntity).

§Example
let mut world = World::new();
let entity = world.spawn(()).id();

assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(false));
assert_eq!(world.try_has_component::<u32>(entity), Ok(false));

world.ensure_component_registered::<ExampleComponent>();
world.ensure_external_registered::<u32>();

world.insert_external_bundle(entity, (ExampleComponent, 42u32));

assert_eq!(world.try_has_component::<ExampleComponent>(entity), Ok(true));
assert_eq!(world.try_has_component::<u32>(entity), Ok(true));
source

pub fn remove<T>(self, entity: impl Entity) -> Result<Option<T>, NoSuchEntity>
where T: 'static,

Removes component from the specified entity and returns its value.

Returns Ok(Some(comp)) if component was removed. Returns Ok(None) if entity does not have component of this type. Returns Err(NoSuchEntity) if entity is not alive.

source

pub fn drop<T>(self, entity: impl Entity) -> Result<(), NoSuchEntity>
where T: 'static,

Drops component from the specified entity.

Returns Err(NoSuchEntity) if entity is not alive.

source

pub fn drop_erased( self, entity: impl Entity, ty: TypeId, ) -> Result<(), NoSuchEntity>

Drops component from the specified entity.

Returns Err(NoSuchEntity) if entity is not alive.

source

pub fn drop_bundle<B>(self, entity: impl Entity) -> Result<(), NoSuchEntity>
where B: Bundle,

Drops entity’s components that are found in the specified bundle.

If entity is not alive, fails with Err(NoSuchEntity).

Unlike other methods that use Bundle trait, this method does not require all components from bundle to be registered in the world. Entity can’t have components that are not registered in the world, so no need to drop them.

For this reason there’s no separate method that uses ComponentBundle trait.

§Example

struct OtherComponent;

let mut world = World::new();
let mut entity = world.spawn((ExampleComponent,)).id();

assert!(world.try_has_component::<ExampleComponent>(entity).unwrap());
world.drop_bundle::<(ExampleComponent, OtherComponent)>(entity).unwrap();
assert!(!world.try_has_component::<ExampleComponent>(entity).unwrap());
source

pub fn add_relation<R>( self, origin: impl Entity, relation: R, target: impl Entity, ) -> Result<(), NoSuchEntity>
where R: Relation,

Adds relation between two entities to the FlowWorld.

If either entity is not alive, fails with Err(NoSuchEntity). When either entity is despawned, relation is removed automatically.

Relations can be queried and filtered using queries from edict::relation module.

Relation must implement Relation trait that defines its behavior.

If relation already exists, then instance is replaced. If relation is symmetric then it is added in both directions. If relation is exclusive, then previous relation on origin is replaced, otherwise relation is added. If relation is exclusive and symmetric, then previous relation on target is replaced, otherwise relation is added.

source

pub fn remove_relation<R>( self, origin: impl Entity, target: impl Entity, ) -> Result<Option<R>, NoSuchEntity>
where R: Relation,

Removes relation between two entities in the FlowWorld.

If either entity is not alive, fails with Err(NoSuchEntity). If relation does not exist, removes None.

When relation is removed, Relation::on_drop behavior is not executed. For symmetric relations Relation::on_target_drop is also not executed.

source

pub fn drop_relation<R>( self, origin: impl Entity, target: impl Entity, ) -> Result<(), NoSuchEntity>
where R: Relation,

Drops relation between two entities in the FlowWorld.

If either entity is not alive, fails with Err(NoSuchEntity). If relation does not exist, does nothing.

When relation is dropped, Relation::on_drop behavior is executed.

source

pub fn insert_resource<T: 'static>(self, resource: T)

Inserts resource instance. Old value is replaced.

To access resource, use FlowWorld::get_resource and FlowWorld::get_resource_mut methods.

§Examples
let mut world = World::new();
world.insert_resource(42i32);
assert_eq!(*world.get_resource::<i32>().unwrap(), 42);
*world.get_resource_mut::<i32>().unwrap() = 11;
assert_eq!(*world.get_resource::<i32>().unwrap(), 11);
source

pub fn with_resource<T: 'static>(self, f: impl FnOnce() -> T)

Returns reference to the resource instance. Inserts new instance if it does not exist.

§Examples
let mut world = World::new();
let value = world.with_resource(|| 42i32);
assert_eq!(*value, 42);
*value = 11;
assert_eq!(*world.get_resource::<i32>().unwrap(), 11);
source

pub fn with_default_resource<T: Default + 'static>(self)

Returns reference to the resource instance. Inserts new instance if it does not exist.

§Examples
let mut world = World::new();
let value = world.with_default_resource::<u32>();
assert_eq!(*value, 0);
*value = 11;
assert_eq!(*world.get_resource::<u32>().unwrap(), 11);
source

pub fn remove_resource<T: 'static>(self) -> Option<T>

Remove resource instance. Returns None if resource was not found.

§Examples
let mut world = World::new();
world.insert_resource(42i32);
assert_eq!(*world.get_resource::<i32>().unwrap(), 42);
world.remove_resource::<i32>();
assert!(world.get_resource::<i32>().is_none());
source

pub fn copy_resource<T: Copy + 'static>(self) -> T

Returns a copy for the Sync resource.

§Panics

This method will panic if resource is missing.

§Examples
let mut world = World::new();
world.copy_resource::<i32>();
let mut world = World::new();
world.insert_resource(42i32);
assert_eq!(world.copy_resource::<i32>(), 42);
source

pub fn clone_resource<T: Clone + 'static>(self) -> T

Returns a clone for the Sync resource.

§Panics

This method will panic if resource is missing.

§Examples
let mut world = World::new();
world.copy_resource::<i32>();
let mut world = World::new();
world.insert_resource(42i32);
assert_eq!(world.copy_resource::<i32>(), 42);
source

pub fn spawn_empty(self) -> FlowEntity

Spawns a new entity in this world without components. Returns FlowEntity for the newly spawned entity. Entity will be alive until FlowWorld::despawn is called with EntityId of the spawned entity, or despawn command recorded and executed by the FlowWorld.

§Panics

If new id cannot be allocated. If too many entities are spawned. Currently limit is set to u32::MAX entities per archetype and usize::MAX overall.

§Example
let mut world = World::new();
let mut entity = world.spawn_empty();
assert!(!entity.has_component::<ExampleComponent>());
source

pub fn spawn_one<T>(self, component: T) -> FlowEntity
where T: Component,

Spawns a new entity in this world with provided component. Returns FlowEntity for the newly spawned entity. Entity will be alive until FlowWorld::despawn is called with EntityId of the spawned entity, or despawn command recorded and executed by the FlowWorld.

§Panics

If new id cannot be allocated. If too many entities are spawned. Currently limit is set to u32::MAX entities per archetype and usize::MAX overall.

§Example
let mut world = World::new();
let mut entity = world.spawn_one(ExampleComponent);
assert!(entity.has_component::<ExampleComponent>());
let ExampleComponent = entity.remove().unwrap();
assert!(!entity.has_component::<ExampleComponent>());
source

pub fn spawn_one_external<T>(self, component: T) -> FlowEntity
where T: 'static,

Spawns a new entity in this world with provided component. Returns FlowEntity for the newly spawned entity. Entity will be alive until FlowWorld::despawn is called with EntityId of the spawned entity, or despawn command recorded and executed by the FlowWorld.

Component must be previously registered. If component implements Component it could be registered implicitly on first call to FlowWorld::spawn, FlowWorld::spawn_one, FlowWorld::spawn_batch, FlowWorld::insert or FlowWorld::insert_bundle and their deferred versions. Otherwise component must be pre-registered explicitly by WorldBuilder::register_component or later by FlowWorld::ensure_component_registered. Non Component type must be pre-registered by WorldBuilder::register_external or later by FlowWorld::ensure_external_registered.

§Panics

If new id cannot be allocated. If too many entities are spawned. Currently limit is set to u32::MAX entities per archetype and usize::MAX overall.

§Example
let mut world = World::new();
world.ensure_external_registered::<u32>();
let mut entity = world.spawn_one_external(42u32);
assert!(entity.has_component::<u32>());
source

pub fn spawn<B>(self, bundle: B) -> FlowEntity

Spawns a new entity in this world with provided bundle of components. Returns FlowEntity for the newly spawned entity. Entity will be alive until FlowWorld::despawn is called with EntityId of the spawned entity, or despawn command recorded and executed by the FlowWorld.

§Panics

If new id cannot be allocated. If too many entities are spawned. Currently limit is set to u32::MAX entities per archetype and usize::MAX overall.

§Example
let mut world = World::new();
let mut entity = world.spawn((ExampleComponent,));
assert!(entity.has_component::<ExampleComponent>());
let ExampleComponent = entity.remove().unwrap();
assert!(!entity.has_component::<ExampleComponent>());
source

pub fn spawn_at<B>(self, id: EntityId, bundle: B) -> FlowEntity

Spawns a new entity in this world with specific ID and bundle of components. The World must be configured to never allocate this ID. Spawned entity is populated with all components from the bundle. Entity will be alive until FlowWorld::despawn is called with the same EntityId.

§Panics

Panics if the id is already used by the world.

§Example
let mut world = World::new();
let id = EntityId::from_bits(42).unwrap();
let mut entity = world.spawn_at(id, (ExampleComponent,));
assert!(entity.has_component::<ExampleComponent>());
let ExampleComponent = entity.remove().unwrap();
assert!(!entity.has_component::<ExampleComponent>());
source

pub fn spawn_or_insert<B>(self, id: EntityId, bundle: B) -> FlowEntity

Spawns a new entity in this world with specific ID and bundle of components. The World must be configured to never allocate this ID. Spawned entity is populated with all components from the bundle. Entity will be alive until FlowWorld::despawn is called with the same EntityId.

§Panics

Panics if the id is already used by the world.

§Example
let mut world = World::new();
let id = EntityId::from_bits(42).unwrap();
let mut entity = world.spawn_or_insert(id, (ExampleComponent,));
assert!(entity.has_component::<ExampleComponent>());
let ExampleComponent = entity.remove().unwrap();
assert!(!entity.has_component::<ExampleComponent>());
source

pub fn spawn_external<B>(self, bundle: B) -> FlowEntity
where B: DynamicBundle,

Spawns a new entity in this world with provided bundle of components. Returns FlowEntity handle to the newly spawned entity. Spawned entity is populated with all components from the bundle. Entity will be alive until despawned.

Components must be previously registered. If component implements Component it could be registered implicitly on first call to FlowWorld::spawn, FlowWorld::spawn_one, FlowWorld::spawn_batch, FlowWorld::insert or FlowWorld::insert_bundle and their deferred versions. Otherwise component must be pre-registered explicitly by WorldBuilder::register_component or later by FlowWorld::ensure_component_registered. Non Component type must be pre-registered by WorldBuilder::register_external or later by FlowWorld::ensure_external_registered.

§Panics

Panics if new id cannot be allocated.

§Example
let mut world = World::new();
world.ensure_external_registered::<u32>();
world.ensure_component_registered::<ExampleComponent>();
let mut entity = world.spawn_external((42u32, ExampleComponent));
assert!(entity.has_component::<u32>());
assert_eq!(entity.remove(), Some(42u32));
assert!(!entity.has_component::<u32>());
source

pub fn spawn_external_at<B>(self, id: EntityId, bundle: B) -> FlowEntity
where B: DynamicBundle,

Spawns a new entity in this world with provided bundle of components. The id must be unused by the world. Spawned entity is populated with all components from the bundle. Entity will be alive until despawned.

Components must be previously registered. If component implements Component it could be registered implicitly on first call to FlowWorld::spawn, FlowWorld::spawn_one, FlowWorld::spawn_batch, FlowWorld::insert or FlowWorld::insert_bundle and their deferred versions. Otherwise component must be pre-registered explicitly by WorldBuilder::register_component or later by FlowWorld::ensure_component_registered. Non Component type must be pre-registered by WorldBuilder::register_external or later by FlowWorld::ensure_external_registered.

§Panics

Panics if the id is already used by the world.

§Example
let mut world = World::new();
world.ensure_external_registered::<u32>();
world.ensure_component_registered::<ExampleComponent>();
let mut entity = world.spawn_external((42u32, ExampleComponent));
assert!(entity.has_component::<u32>());
assert_eq!(entity.remove(), Some(42u32));
assert!(!entity.has_component::<u32>());
source

pub fn spawn_batch<B, I>(self, bundles: I) -> SpawnBatch<I::IntoIter>
where I: IntoIterator<Item = B>, B: ComponentBundle,

Returns an iterator which spawns and yield entities using bundles yielded from provided bundles iterator.

When bundles iterator returns None, returned iterator returns None too.

If bundles iterator is fused, returned iterator is fused too. If bundles iterator is double-ended, returned iterator is double-ended too. If bundles iterator has exact size, returned iterator has exact size too.

Skipping items on returned iterator will cause bundles iterator skip bundles and not spawn entities.

Returned iterator attempts to optimize storage allocation for entities if consumed with functions like fold, rfold, for_each or collect.

When returned iterator is dropped, no more entities will be spawned even if bundles iterator has items left.

source

pub fn spawn_batch_external<B, I>(self, bundles: I) -> SpawnBatch<I::IntoIter>
where I: IntoIterator<Item = B>, B: Bundle,

Returns an iterator which spawns and yield entities using bundles yielded from provided bundles iterator.

When bundles iterator returns None, returned iterator returns None too.

If bundles iterator is fused, returned iterator is fused too. If bundles iterator is double-ended, returned iterator is double-ended too. If bundles iterator has exact size, returned iterator has exact size too.

Skipping items on returned iterator will cause bundles iterator skip bundles and not spawn entities.

Returned iterator attempts to optimize storage allocation for entities if consumed with functions like fold, rfold, for_each or collect.

When returned iterator is dropped, no more entities will be spawned even if bundles iterator has items left.

Components must be previously registered. If component implements Component it could be registered implicitly on first call to FlowWorld::spawn, FlowWorld::spawn_one, FlowWorld::spawn_batch, FlowWorld::insert or FlowWorld::insert_bundle and their deferred versions. Otherwise component must be pre-registered explicitly by WorldBuilder::register_component or later by FlowWorld::ensure_component_registered. Non Component type must be pre-registered by WorldBuilder::register_external or later by FlowWorld::ensure_external_registered.

source

pub fn despawn(self, entity: impl Entity) -> Result<(), NoSuchEntity>

Despawns an entity with specified id. Returns [Err(NoSuchEntity)] if entity does not exists.

§Example
let mut world = World::new();
let entity = world.spawn((ExampleComponent,)).id();
assert!(world.despawn(entity).is_ok(), "Entity should be despawned by this call");
assert!(world.despawn(entity).is_err(), "Already despawned");
source

pub fn ensure_component_registered<T>(self)
where T: Component,

Explicitly registers component type.

Unlike WorldBuilder::register_component method, this method does not return reference to component configuration, once FlowWorld is created overriding component behavior is not possible.

Component types are implicitly registered on first use by most methods. This method is only needed if you want to use component type using FlowWorld::insert_external, FlowWorld::insert_external_bundle or FlowWorld::spawn_external.

source

pub fn ensure_external_registered<T>(&mut self)
where T: 'static,

Explicitly registers external type.

Unlike WorldBuilder::register_external method, this method does not return reference to component configuration, once FlowWorld is created overriding component behavior is not possible.

External component types are not implicitly registered on first use. This method is needed if you want to use component type with FlowWorld::insert_external, FlowWorld::insert_external_bundle or FlowWorld::spawn_external.

source

pub fn ensure_bundle_registered<B>(&mut self)
where B: ComponentBundle,

Explicitly registers bundle of component types.

This method is only needed if you want to use bundle of component types using FlowWorld::insert_external_bundle or FlowWorld::spawn_external.

source

pub fn assert_bundle_registered<B>(&self)
where B: Bundle,

Asserts that all components from the bundle are registered.

source§

impl FlowWorld

source

pub fn spawn_flow<F>(self, flow: F)
where F: IntoFlow,

Spawn a flow in the world. It will be polled during Flows::execute until completion.

source

pub fn spawn_flow_for<F>(&self, entity: EntityId, flow: F)
where F: IntoEntityFlow,

Spawns a flow for an entity in the world. It will be polled during Flows::execute until completion or until the entity is despawned.

Trait Implementations§

source§

impl Clone for FlowWorld

source§

fn clone(&self) -> FlowWorld

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FlowWorld

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for FlowWorld

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.