[][src]Struct arcs::commands::ChangeRecorder

pub struct ChangeRecorder<'world> { /* fields omitted */ }

A wrapper around a World which records any changes that are made.

Methods

impl<'world> ChangeRecorder<'world>[src]

pub fn new(world: &'world World) -> Self[src]

pub fn create_entity(&mut self) -> Builder[src]

Create a new Entity.

pub fn delete_entity(&mut self, entity: Entity)[src]

Delete an Entity and any components associated with it.

pub fn set_component<C: Component + Clone>(
    &mut self,
    entity: Entity,
    component: C
)
[src]

Associate a new Component with a particular Entity.

pub fn get_component<C: Component + Clone>(&self, entity: Entity) -> Option<C>[src]

Look up the Component associated with an Entity.

This performs a copy because 9 times out of 10 you'll mutate the value and pass it to ChangeRecorder::set_component() anyway... plus the borrow checker complains because we save where the component is stored as a local and returning &C would lead to dangling pointers.

pub fn delete_component<C: Component + Clone>(&mut self, entity: Entity)[src]

Removes a Component from this Entity.

pub fn into_changes(self) -> ChangeSet[src]

Extract the list of [Change]s.

Auto Trait Implementations

impl<'world> !RefUnwindSafe for ChangeRecorder<'world>

impl<'world> !Send for ChangeRecorder<'world>

impl<'world> !Sync for ChangeRecorder<'world>

impl<'world> Unpin for ChangeRecorder<'world>

impl<'world> !UnwindSafe for ChangeRecorder<'world>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T[src]

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.