pub struct SkinnedInstancePool { /* private fields */ }Expand description
Recycles skinned draw slots as skinned instances spawn and despawn.
Implementations§
Source§impl SkinnedInstancePool
impl SkinnedInstancePool
Sourcepub fn reserve(&mut self, template: usize, instance: usize)
pub fn reserve(&mut self, template: usize, instance: usize)
Record a pre-reserved instance slot as free and owned by template.
Called once per expanded copy at load.
Sourcepub fn acquire(&mut self, template: usize) -> Option<usize>
pub fn acquire(&mut self, template: usize) -> Option<usize>
Claim a free instance slot for template, or None when the reserve is
exhausted (more live copies than were pre-reserved).
Sourcepub fn release(&mut self, instance: usize) -> bool
pub fn release(&mut self, instance: usize) -> bool
Return a live instance slot to its template’s free list. Returns false if the slot was never a pre-reserved instance (e.g. an authored template slot), so the caller can tell a recyclable slot from a fixed one.
Sourcepub fn total_free(&self) -> usize
pub fn total_free(&self) -> usize
Total free slots across every template. Surfaced through the debug profile so a probe can watch the pool drain on spawn and refill on despawn, a direct check on the free-list recycle.
Trait Implementations§
Source§impl Debug for SkinnedInstancePool
impl Debug for SkinnedInstancePool
Source§impl Default for SkinnedInstancePool
impl Default for SkinnedInstancePool
Source§fn default() -> SkinnedInstancePool
fn default() -> SkinnedInstancePool
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SkinnedInstancePool
impl RefUnwindSafe for SkinnedInstancePool
impl Send for SkinnedInstancePool
impl Sync for SkinnedInstancePool
impl Unpin for SkinnedInstancePool
impl UnsafeUnpin for SkinnedInstancePool
impl UnwindSafe for SkinnedInstancePool
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