pub struct ChunkDependencies {
dependency_by_radius: [Option<ChunkStatus>; 16],
len: usize,
radius_by_dependency: [usize; 12],
}Expand description
A collection of chunk dependencies (const-compatible).
Fields§
§dependency_by_radius: [Option<ChunkStatus>; 16]§len: usize§radius_by_dependency: [usize; 12]Implementations§
Source§impl ChunkDependencies
impl ChunkDependencies
Sourceconst fn from_requirements(
reqs: &[(ChunkStatus, usize)],
parent_status: Option<ChunkStatus>,
) -> Self
const fn from_requirements( reqs: &[(ChunkStatus, usize)], parent_status: Option<ChunkStatus>, ) -> Self
Creates dependencies from requirements and optional parent status.
Sourceconst fn build_radius_lookup(
deps: &[Option<ChunkStatus>; 16],
len: usize,
) -> [usize; 12]
const fn build_radius_lookup( deps: &[Option<ChunkStatus>; 16], len: usize, ) -> [usize; 12]
Builds the radius lookup table from dependency array.
Sourceconst fn accumulate(
&self,
parent_accumulated: &Self,
parent_status: ChunkStatus,
) -> Self
const fn accumulate( &self, parent_accumulated: &Self, parent_status: ChunkStatus, ) -> Self
Computes accumulated dependencies by merging with parent’s accumulated dependencies.
Sourcepub const fn get_radius_of(&self, status: ChunkStatus) -> usize
pub const fn get_radius_of(&self, status: ChunkStatus) -> usize
Gets the radius of the dependencies for the given status.
§Panics
Panics if the status index is out of bounds.
Sourcepub const fn get_radius(&self) -> usize
pub const fn get_radius(&self) -> usize
Gets the radius of the dependencies.
Sourcepub const fn get(&self, distance: usize) -> Option<ChunkStatus>
pub const fn get(&self, distance: usize) -> Option<ChunkStatus>
Gets the dependency status at the given distance.
Trait Implementations§
Source§impl Clone for ChunkDependencies
impl Clone for ChunkDependencies
Source§fn clone(&self) -> ChunkDependencies
fn clone(&self) -> ChunkDependencies
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 moreimpl Copy for ChunkDependencies
Auto Trait Implementations§
impl Freeze for ChunkDependencies
impl RefUnwindSafe for ChunkDependencies
impl Send for ChunkDependencies
impl Sync for ChunkDependencies
impl Unpin for ChunkDependencies
impl UnsafeUnpin for ChunkDependencies
impl UnwindSafe for ChunkDependencies
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<>>