pub struct TileId {
pub z: u8,
pub x: u32,
pub y: u32,
pub t: u64,
}Expand description
Unique identifier for a spatiotemporal tile
Fields§
§z: u8Zoom level (0-22)
x: u32X coordinate
y: u32Y coordinate
t: u64Timestamp (Unix milliseconds)
Implementations§
Source§impl TileId
impl TileId
Sourcepub fn hilbert_index(&self) -> u64
pub fn hilbert_index(&self) -> u64
Calculate Hilbert curve index for spatial ordering.
Uses the integer (discrete) Hilbert curve at the tile’s own zoom
order, so neighbouring tiles never collide on the directory sort key.
The previous implementation normalised (x, y) to f64 [0,1) and
multiplied by u64::MAX. f64 has only a 52-bit mantissa, so at
zoom ≥ 14 the per-axis precision was already at the mantissa limit and
the post-multiply discarded trailing bits — neighbouring tiles could
collide on the same hilbert_index, silently degrading the archive’s
range-coalescing locality. The integer variant is also ~10× faster.
Trait Implementations§
impl Copy for TileId
impl Eq for TileId
Source§impl Ord for TileId
impl Ord for TileId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for TileId
impl PartialOrd for TileId
impl StructuralPartialEq for TileId
Auto Trait Implementations§
impl Freeze for TileId
impl RefUnwindSafe for TileId
impl Send for TileId
impl Sync for TileId
impl Unpin for TileId
impl UnsafeUnpin for TileId
impl UnwindSafe for TileId
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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