[−][src]Struct arcs::commands::ChangeRecorder
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]
&mut self,
entity: Entity,
component: C
)
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]
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]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,
fn round_into(self) -> U
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,