pub struct Store<T> { /* private fields */ }Implementations§
Source§impl<T> Store<T>
impl<T> Store<T>
pub fn untracked() -> Self
pub fn tracked(capacity: LogCapacity) -> Self
pub fn is_tracked(&self) -> bool
pub fn log_capacity(&self) -> Option<LogCapacity>
pub fn scene(&self) -> SceneId
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, entity: Entity) -> bool
Sourcepub fn dense_index(&self, entity: Entity) -> Option<usize>
pub fn dense_index(&self, entity: Entity) -> Option<usize>
Stable between structural boundaries and meaningless across them.
pub fn entity_at(&self, dense: usize) -> Option<Entity>
pub fn get(&self, entity: Entity) -> Option<&T>
pub fn get_mut(&mut self, entity: Entity) -> Option<&mut T>
Sourcepub fn pair_mut(&mut self, a: Entity, b: Entity) -> Option<(&mut T, &mut T)>
pub fn pair_mut(&mut self, a: Entity, b: Entity) -> Option<(&mut T, &mut T)>
Two disjoint mutable rows of one store; equal handles yield None.
pub fn rows(&self) -> &[T]
pub fn iter(&self) -> impl Iterator<Item = (Entity, &T)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (Entity, &mut T)>
pub fn insert( &mut self, entities: &Entities, entity: Entity, row: T, ) -> Result<(), StoreError>
pub fn remove(&mut self, entity: Entity) -> Result<T, StoreError>
Sourcepub fn partition<'a>(
&'a mut self,
cuts: &'a [usize],
) -> Result<Partition<'a, T>, PartitionError>
pub fn partition<'a>( &'a mut self, cuts: &'a [usize], ) -> Result<Partition<'a, T>, PartitionError>
cuts must be strictly ascending and within len.
Sourcepub fn boundary(&mut self)
pub fn boundary(&mut self)
Counts toward cursor expiry; the session calls it once per boundary.
Sourcepub fn version(&self, entity: Entity) -> Option<Version>
pub fn version(&self, entity: Entity) -> Option<Version>
None for an untracked store or an entity it does not hold.
pub fn changes(&self, cursor: &mut Cursor) -> Changes<'_, T> ⓘ
Sourcepub fn changed_since(&self, cursor: &mut Cursor) -> bool
pub fn changed_since(&self, cursor: &mut Cursor) -> bool
An untracked store or an expired cursor counts as changed; a clean check renews the cursor’s expiry.
pub fn catch_up(&self, cursor: &mut Cursor)
Trait Implementations§
Source§impl<T: Clone + Send + 'static> StoreField for Store<T>
impl<T: Clone + Send + 'static> StoreField for Store<T>
type Snapshot = StoreSnapshot<T>
fn bind(&mut self, scene: SceneId, _owner: Owner)
fn snapshot(&self) -> StoreSnapshot<T>
fn restore(&mut self, from: &StoreSnapshot<T>, scene: SceneId, _owner: Owner)
fn boundary(&mut self, _owner: Owner)
fn release(&mut self, entity: Entity, _owner: Owner)
Auto Trait Implementations§
impl<T> !Freeze for Store<T>
impl<T> RefUnwindSafe for Store<T>where
T: RefUnwindSafe,
impl<T> Send for Store<T>where
T: Send,
impl<T> Sync for Store<T>where
T: Sync,
impl<T> Unpin for Store<T>where
T: Unpin,
impl<T> UnsafeUnpin for Store<T>
impl<T> UnwindSafe for Store<T>where
T: UnwindSafe,
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