pub struct EffectTable { /* private fields */ }Expand description
Sparse slot-recycled table storing rare PaintEffectEntry payloads indexed by 1-based effect_id (0 = none).
Implementations§
Source§impl EffectTable
Slot-recycled sparse effect storage operations for EffectTable.
impl EffectTable
Slot-recycled sparse effect storage operations for EffectTable.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty EffectTable with zero initial heap allocations.
§Returns
Self- Empty effect table.
Sourcepub fn get(&self, effect_id: u32) -> Option<&PaintEffectEntry>
pub fn get(&self, effect_id: u32) -> Option<&PaintEffectEntry>
Sourcepub fn insert(&mut self, entry: PaintEffectEntry) -> u32
pub fn insert(&mut self, entry: PaintEffectEntry) -> u32
Sourcepub fn update(&mut self, current_id: u32, entry: PaintEffectEntry) -> u32
pub fn update(&mut self, current_id: u32, entry: PaintEffectEntry) -> u32
Updates an existing effect_id in place, allocating on transition from none and freeing on transition to empty.
§Arguments
&Self- Mutable effect table.u32- Previous 1-based effect identifier (EFFECT_ID_NONEif none).PaintEffectEntry- Replacement effect payload.
§Returns
u32- Updated 1-based effect identifier orEFFECT_ID_NONE.
Trait Implementations§
Source§impl Clone for EffectTable
impl Clone for EffectTable
Source§impl Debug for EffectTable
impl Debug for EffectTable
Source§impl Default for EffectTable
impl Default for EffectTable
Source§impl PartialEq for EffectTable
impl PartialEq for EffectTable
impl StructuralPartialEq for EffectTable
Auto Trait Implementations§
impl Forget for EffectTable
impl Freeze for EffectTablewhere
*const u8 is !null: Freeze,
PhantomData<Option<PaintEffectEntry>>: Freeze,
PhantomData<u32>: Freeze,
impl Move for EffectTable
impl RefUnwindSafe for EffectTable
impl Send for EffectTablewhere
RawVecInner: Send,
impl Sync for EffectTablewhere
RawVecInner: Sync,
impl Unpin for EffectTable
impl UnsafeUnpin for EffectTablewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<PaintEffectEntry>>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
impl UnwindSafe for EffectTablewhere
RawVecInner: 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