pub struct LightChunkSlotArray<T> {
values: Box<[Option<T>]>,
}Expand description
Optional value slots for ScalableLux’s 5x5 chunk cache arrays.
Fields§
§values: Box<[Option<T>]>Implementations§
Source§impl<T> LightChunkSlotArray<T>
impl<T> LightChunkSlotArray<T>
Sourcepub fn slot_count(&self) -> usize
pub fn slot_count(&self) -> usize
Returns the number of chunk slots.
Sourcepub fn insert(&mut self, chunk: CachedLightChunk, value: T) -> Option<T>
pub fn insert(&mut self, chunk: CachedLightChunk, value: T) -> Option<T>
Inserts a value at a cached chunk slot.
Sourcepub fn insert_slot(&mut self, chunk_slot: usize, value: T) -> Option<T>
pub fn insert_slot(&mut self, chunk_slot: usize, value: T) -> Option<T>
Inserts a value at a raw chunk slot.
Sourcepub fn get(&self, chunk: CachedLightChunk) -> Option<&T>
pub fn get(&self, chunk: CachedLightChunk) -> Option<&T>
Returns the value at a cached chunk slot.
Sourcepub fn get_mut(&mut self, chunk: CachedLightChunk) -> Option<&mut T>
pub fn get_mut(&mut self, chunk: CachedLightChunk) -> Option<&mut T>
Returns the mutable value at a cached chunk slot.
Sourcepub fn get_mut_slot(&mut self, chunk_slot: usize) -> Option<&mut T>
pub fn get_mut_slot(&mut self, chunk_slot: usize) -> Option<&mut T>
Returns the mutable value at a raw chunk slot.
Trait Implementations§
Source§impl<T: Clone> Clone for LightChunkSlotArray<T>
impl<T: Clone> Clone for LightChunkSlotArray<T>
Source§fn clone(&self) -> LightChunkSlotArray<T>
fn clone(&self) -> LightChunkSlotArray<T>
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<T: Debug> Debug for LightChunkSlotArray<T>
impl<T: Debug> Debug for LightChunkSlotArray<T>
Auto Trait Implementations§
impl<T> Freeze for LightChunkSlotArray<T>
impl<T> RefUnwindSafe for LightChunkSlotArray<T>where
T: RefUnwindSafe,
impl<T> Send for LightChunkSlotArray<T>where
T: Send,
impl<T> Sync for LightChunkSlotArray<T>where
T: Sync,
impl<T> Unpin for LightChunkSlotArray<T>
impl<T> UnsafeUnpin for LightChunkSlotArray<T>
impl<T> UnwindSafe for LightChunkSlotArray<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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 moreWraps this value in an
Arc<SyncMutex<>>