Enum h3ron::H3Direction
source · pub enum H3Direction {
CenterDigit = 0,
KAxesDigit = 1,
JAxesDigit = 2,
JkAxesDigit = 3,
IAxesDigit = 4,
IkAxesDigit = 5,
IjAxesDigit = 6,
}
Expand description
H3 digit representing ijk+ axes direction. See documentation
j Axis
___
/ \
+--+ 2 +--+
/ 3 \___/ 6 \
\ / \ /
+--+ 0 +--+
/ \___/ \
\ 1 / \ 4 /
+--+ 5 +--+ i Axis
k Axis \___/
Variants§
CenterDigit = 0
H3 digit in center
KAxesDigit = 1
H3 digit in k-axes direction
JAxesDigit = 2
H3 digit in j-axes direction
JkAxesDigit = 3
H3 digit in j==k direction
IAxesDigit = 4
H3 digit in i-axes direction
IkAxesDigit = 5
H3 digit in i==k direction
IjAxesDigit = 6
H3 digit in i==j direction
Implementations§
source§impl H3Direction
impl H3Direction
sourcepub fn direction_to_parent<I: Index>(index: &I) -> Result<Self, Error>
pub fn direction_to_parent<I: Index>(index: &I) -> Result<Self, Error>
Retrieves the H3 Direction of the index
relative to its direct parent
Errors
May fail if the direction is invalid. This can be caused by trying to retrieve a direction for:
- an index of 0 resolution
- an invalid index
sourcepub fn direction<I: Index>(index: &I) -> Result<Self, Error>
pub fn direction<I: Index>(index: &I) -> Result<Self, Error>
Retrieves the H3 Direction of the index
Errors
May fail if the direction is invalid. This can be caused by trying to retrieve a direction for:
- an index of 0 resolution
- an invalid index
sourcepub fn direction_to_parent_resolution<I: Index>(
index: &I,
target_resolution: u8
) -> Result<Self, Error>
pub fn direction_to_parent_resolution<I: Index>( index: &I, target_resolution: u8 ) -> Result<Self, Error>
Retrieves the H3 Direction of the index
relative to its parent at target_resolution
.
The function may fail if target_resolution
is higher than index
resolution
sourcepub fn iter_directions_over_resolutions<I: Index>(
index: &I
) -> ResolutionDirectionIter
pub fn iter_directions_over_resolutions<I: Index>( index: &I ) -> ResolutionDirectionIter
iterate over all directions leading to the given index
starting from
resolution 0 to the resolution of the index
.
Trait Implementations§
source§impl Clone for H3Direction
impl Clone for H3Direction
source§fn clone(&self) -> H3Direction
fn clone(&self) -> H3Direction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for H3Direction
impl Debug for H3Direction
source§impl Hash for H3Direction
impl Hash for H3Direction
source§impl Ord for H3Direction
impl Ord for H3Direction
source§fn cmp(&self, other: &H3Direction) -> Ordering
fn cmp(&self, other: &H3Direction) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for H3Direction
impl PartialEq for H3Direction
source§fn eq(&self, other: &H3Direction) -> bool
fn eq(&self, other: &H3Direction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for H3Direction
impl PartialOrd for H3Direction
source§fn partial_cmp(&self, other: &H3Direction) -> Option<Ordering>
fn partial_cmp(&self, other: &H3Direction) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<u8> for H3Direction
impl TryFrom<u8> for H3Direction
impl Copy for H3Direction
impl Eq for H3Direction
impl StructuralEq for H3Direction
impl StructuralPartialEq for H3Direction
Auto Trait Implementations§
impl RefUnwindSafe for H3Direction
impl Send for H3Direction
impl Sync for H3Direction
impl Unpin for H3Direction
impl UnwindSafe for H3Direction
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
§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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.