pub struct CoordinateGeneration(/* private fields */);Expand description
How many times the coordinates of a structure have changed.
Everything derived from positions — spatial indices, cached distances, views handed to a caller — records the generation it was built against. Using one after the coordinates moved is then a detectable mistake rather than a silently wrong answer.
Implementations§
Source§impl CoordinateGeneration
impl CoordinateGeneration
Sourcepub const INITIAL: CoordinateGeneration
pub const INITIAL: CoordinateGeneration
The generation of a structure that has not been edited.
Sourcepub const fn from_raw(value: u64) -> CoordinateGeneration
pub const fn from_raw(value: u64) -> CoordinateGeneration
Rebuilds a generation from a value previously produced by this type.
The counter is opaque to callers that only need freshness checks, but
preserving it at an interop boundary is useful when a cached view is
serialised or handed between language runtimes. No validation is
required because every u64 is a representable generation.
Sourcepub const fn next(self) -> Option<CoordinateGeneration>
pub const fn next(self) -> Option<CoordinateGeneration>
Returns the next generation, or None when the counter is exhausted.
Trait Implementations§
Source§impl Clone for CoordinateGeneration
impl Clone for CoordinateGeneration
Source§fn clone(&self) -> CoordinateGeneration
fn clone(&self) -> CoordinateGeneration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CoordinateGeneration
Source§impl Debug for CoordinateGeneration
impl Debug for CoordinateGeneration
Source§impl Default for CoordinateGeneration
impl Default for CoordinateGeneration
Source§fn default() -> CoordinateGeneration
fn default() -> CoordinateGeneration
impl Eq for CoordinateGeneration
Source§impl Hash for CoordinateGeneration
impl Hash for CoordinateGeneration
Source§impl Ord for CoordinateGeneration
impl Ord for CoordinateGeneration
Source§fn cmp(&self, other: &CoordinateGeneration) -> Ordering
fn cmp(&self, other: &CoordinateGeneration) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CoordinateGeneration
impl PartialEq for CoordinateGeneration
Source§impl PartialOrd for CoordinateGeneration
impl PartialOrd for CoordinateGeneration
impl StructuralPartialEq for CoordinateGeneration
Auto Trait Implementations§
impl Freeze for CoordinateGeneration
impl RefUnwindSafe for CoordinateGeneration
impl Send for CoordinateGeneration
impl Sync for CoordinateGeneration
impl Unpin for CoordinateGeneration
impl UnsafeUnpin for CoordinateGeneration
impl UnwindSafe for CoordinateGeneration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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