pub struct CommandBuffer { /* private fields */ }Expand description
A command buffer for entity changes.
This is used as an allocated list of Snapshot modifications.
The primary benefit is that this can be kept around between snapshot
modifications and applied later. With CommandBuffers multiple systems can
determine changes in parallel and apply them at the end.
Implementations§
Source§impl CommandBuffer
impl CommandBuffer
Sourcepub fn new() -> CommandBuffer
pub fn new() -> CommandBuffer
Create a new, empty, command buffer.
Sourcepub fn merge(buffers: &[&CommandBuffer]) -> CommandBuffer
pub fn merge(buffers: &[&CommandBuffer]) -> CommandBuffer
Merge multiple command buffers.
If multiple command buffers reference the same component, the rightmost wins.
Sourcepub fn iter_edits(&self) -> CommandBufferIterator<'_>
pub fn iter_edits(&self) -> CommandBufferIterator<'_>
Iterate over the edit list for this command buffer.
This is usually used with Snapshot::modify.
Sourcepub fn set_component<T: Component>(
&mut self,
entity_id: EntityID,
component: &T,
)
pub fn set_component<T: Component>( &mut self, entity_id: EntityID, component: &T, )
Set a single component on an entity.
Sourcepub fn remove_component<T: Component>(&mut self, entity_id: EntityID)
pub fn remove_component<T: Component>(&mut self, entity_id: EntityID)
Remove a single component from an entity.
Trait Implementations§
Source§impl Clone for CommandBuffer
impl Clone for CommandBuffer
Source§fn clone(&self) -> CommandBuffer
fn clone(&self) -> CommandBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CommandBuffer
impl RefUnwindSafe for CommandBuffer
impl Send for CommandBuffer
impl Sync for CommandBuffer
impl Unpin for CommandBuffer
impl UnwindSafe for CommandBuffer
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
Mutably borrows from an owned value. Read more