pub struct ComponentStore { /* private fields */ }Expand description
Station-local sparse component blob store.
Implementations§
Source§impl ComponentStore
impl ComponentStore
Sourcepub fn set_blob(
&mut self,
descriptor: &ComponentDescriptor,
entity: EntityHandle,
version: u64,
bytes: Vec<u8>,
) -> Result<(), ComponentStoreError>
pub fn set_blob( &mut self, descriptor: &ComponentDescriptor, entity: EntityHandle, version: u64, bytes: Vec<u8>, ) -> Result<(), ComponentStoreError>
Writes an opaque component blob.
Sourcepub fn set_typed<T, C: ComponentCodec<T>>(
&mut self,
descriptor: &ComponentDescriptor,
entity: EntityHandle,
version: u64,
codec: &C,
value: &T,
) -> Result<(), ComponentStoreError>
pub fn set_typed<T, C: ComponentCodec<T>>( &mut self, descriptor: &ComponentDescriptor, entity: EntityHandle, version: u64, codec: &C, value: &T, ) -> Result<(), ComponentStoreError>
Encodes and writes a typed component value using codec.
Sourcepub fn get_blob(
&self,
component_id: ComponentId,
entity: EntityHandle,
) -> Option<&ComponentBlob>
pub fn get_blob( &self, component_id: ComponentId, entity: EntityHandle, ) -> Option<&ComponentBlob>
Gets an opaque component blob.
Sourcepub fn get_typed<T, C: ComponentCodec<T>>(
&self,
component_id: ComponentId,
entity: EntityHandle,
codec: &C,
) -> Result<T, ComponentStoreError>
pub fn get_typed<T, C: ComponentCodec<T>>( &self, component_id: ComponentId, entity: EntityHandle, codec: &C, ) -> Result<T, ComponentStoreError>
Decodes a typed component value using codec.
Sourcepub fn get_blob_mut(
&mut self,
component_id: ComponentId,
entity: EntityHandle,
) -> Option<&mut ComponentBlob>
pub fn get_blob_mut( &mut self, component_id: ComponentId, entity: EntityHandle, ) -> Option<&mut ComponentBlob>
Gets a mutable opaque component blob.
Sourcepub fn clear_dirty_for_entity(&mut self, entity: EntityHandle) -> usize
pub fn clear_dirty_for_entity(&mut self, entity: EntityHandle) -> usize
Clears dirty flags for all components on one entity.
Sourcepub fn remove_entity(
&mut self,
entity: EntityHandle,
) -> Vec<(ComponentId, ComponentBlob)>
pub fn remove_entity( &mut self, entity: EntityHandle, ) -> Vec<(ComponentId, ComponentBlob)>
Removes all component blobs for an entity and returns the removed values.
Sourcepub fn copy_for_migration(
&mut self,
registry: &ComponentRegistry,
source: EntityHandle,
target: EntityHandle,
) -> usize
pub fn copy_for_migration( &mut self, registry: &ComponentRegistry, source: EntityHandle, target: EntityHandle, ) -> usize
Copies migratable component blobs from one entity handle to another.
Sourcepub fn blob_count(&self) -> usize
pub fn blob_count(&self) -> usize
Returns number of component blobs stored in all columns.
Trait Implementations§
Source§impl Clone for ComponentStore
impl Clone for ComponentStore
Source§fn clone(&self) -> ComponentStore
fn clone(&self) -> ComponentStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentStore
impl Debug for ComponentStore
Source§impl Default for ComponentStore
impl Default for ComponentStore
Source§fn default() -> ComponentStore
fn default() -> ComponentStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ComponentStore
impl RefUnwindSafe for ComponentStore
impl Send for ComponentStore
impl Sync for ComponentStore
impl Unpin for ComponentStore
impl UnsafeUnpin for ComponentStore
impl UnwindSafe for ComponentStore
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