Struct NodePoolSlice
pub struct NodePoolSlice<'a> {
pub records: &'a mut [SceneNodeRecord],
pub generations: &'a mut [u32],
pub active: &'a mut [bool],
pub free_indices: &'a mut [u32],
pub free_len: &'a mut usize,
pub active_count: &'a mut usize,
pub current_tick: &'a mut u32,
}Expand description
Slice-backed view over caller-provided arena slices (supports up to MAX_SCENE_ARENA_NODES = 16,384+ nodes).
Fields§
§records: &'a mut [SceneNodeRecord]§generations: &'a mut [u32]§active: &'a mut [bool]§free_indices: &'a mut [u32]§free_len: &'a mut usize§active_count: &'a mut usize§current_tick: &'a mut u32Implementations§
§impl<'a> NodePoolSlice<'a>
impl<'a> NodePoolSlice<'a>
pub fn init_arena(
records: &'a mut [SceneNodeRecord],
generations: &'a mut [u32],
active: &'a mut [bool],
free_indices: &'a mut [u32],
free_len: &'a mut usize,
active_count: &'a mut usize,
current_tick: &'a mut u32,
) -> NodePoolSlice<'a>
pub fn init_arena( records: &'a mut [SceneNodeRecord], generations: &'a mut [u32], active: &'a mut [bool], free_indices: &'a mut [u32], free_len: &'a mut usize, active_count: &'a mut usize, current_tick: &'a mut u32, ) -> NodePoolSlice<'a>
Initializes caller-supplied slices as an empty generational node pool.
pub fn capacity(&self) -> usize
pub fn is_valid(&self, handle: NodeHandle) -> bool
pub fn spawn(&mut self, record: SceneNodeRecord) -> Option<NodeHandle>
pub fn spawn(&mut self, record: SceneNodeRecord) -> Option<NodeHandle>
$O(1)$ node allocation from the free stack.
pub fn despawn(&mut self, handle: NodeHandle) -> bool
pub fn despawn(&mut self, handle: NodeHandle) -> bool
$O(1)$ node deallocation; detaches from parent and orphans direct children cleanly.
pub fn get(&self, handle: NodeHandle) -> Option<&SceneNodeRecord>
pub fn get_mut(&mut self, handle: NodeHandle) -> Option<&mut SceneNodeRecord>
pub fn detach_from_parent(&mut self, child: NodeHandle) -> bool
pub fn detach_from_parent(&mut self, child: NodeHandle) -> bool
Detaches child from its current parent in $O(1)$ time.
pub fn attach_child(&mut self, parent: NodeHandle, child: NodeHandle) -> bool
pub fn attach_child(&mut self, parent: NodeHandle, child: NodeHandle) -> bool
Attaches child as the first child of parent in $O(1)$ time.
Auto Trait Implementations§
impl<'a> !UnwindSafe for NodePoolSlice<'a>
impl<'a> Freeze for NodePoolSlice<'a>
impl<'a> RefUnwindSafe for NodePoolSlice<'a>
impl<'a> Send for NodePoolSlice<'a>
impl<'a> Sync for NodePoolSlice<'a>
impl<'a> Unpin for NodePoolSlice<'a>
impl<'a> UnsafeUnpin for NodePoolSlice<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more