pub struct Index64 { /* private fields */ }Expand description
64-bit database key using Morton (Z-order) encoding
Bit layout:
- Bits 63..62: Hdr = 10 (identifies Index64)
- Bits 61..60: ScaleTier (2 bits)
- Bits 59..52: FrameID (8 bits)
- Bits 51..48: LOD (4 bits)
- Bits 47.. 0: Morton3D (48 bits, 16 bits per axis)
Implementations§
Source§impl Index64
impl Index64
Sourcepub fn new(
frame: FrameId,
tier: u8,
lod: u8,
x16: u16,
y16: u16,
z16: u16,
) -> Result<Self>
pub fn new( frame: FrameId, tier: u8, lod: u8, x16: u16, y16: u16, z16: u16, ) -> Result<Self>
Create new Index64
Sourcepub fn scale_tier(&self) -> u8
pub fn scale_tier(&self) -> u8
Extract scale tier
Sourcepub fn decode_coords(&self) -> (u16, u16, u16)
pub fn decode_coords(&self) -> (u16, u16, u16)
Decode to 16-bit coordinates
Sourcepub fn to_bech32m(&self) -> Result<String>
pub fn to_bech32m(&self) -> Result<String>
Encode to Bech32m string
Sourcepub fn from_bech32m(s: &str) -> Result<Self>
pub fn from_bech32m(s: &str) -> Result<Self>
Decode from Bech32m string
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Index64
impl<'de> Deserialize<'de> for Index64
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Index64
impl Ord for Index64
Source§impl PartialOrd for Index64
impl PartialOrd for Index64
impl Copy for Index64
impl Eq for Index64
impl StructuralPartialEq for Index64
Auto Trait Implementations§
impl Freeze for Index64
impl RefUnwindSafe for Index64
impl Send for Index64
impl Sync for Index64
impl Unpin for Index64
impl UnwindSafe for Index64
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,
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