Enum h3ron::H3Direction
source · [−]pub enum H3Direction {
CenterDigit,
KAxesDigit,
JAxesDigit,
JkAxesDigit,
IAxesDigit,
IkAxesDigit,
IjAxesDigit,
}
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
H3 digit in center
KAxesDigit
H3 digit in k-axes direction
JAxesDigit
H3 digit in j-axes direction
JkAxesDigit
H3 digit in j==k direction
IAxesDigit
H3 digit in i-axes direction
IkAxesDigit
H3 digit in i==k direction
IjAxesDigit
H3 digit in i==j direction
Implementations
sourceimpl 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
sourceimpl Clone for H3Direction
impl Clone for H3Direction
sourcefn clone(&self) -> H3Direction
fn clone(&self) -> H3Direction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for H3Direction
impl Debug for H3Direction
sourceimpl Hash for H3Direction
impl Hash for H3Direction
sourceimpl Ord for H3Direction
impl Ord for H3Direction
sourcefn cmp(&self, other: &H3Direction) -> Ordering
fn cmp(&self, other: &H3Direction) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<H3Direction> for H3Direction
impl PartialEq<H3Direction> for H3Direction
sourcefn eq(&self, other: &H3Direction) -> bool
fn eq(&self, other: &H3Direction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialOrd<H3Direction> for H3Direction
impl PartialOrd<H3Direction> for H3Direction
sourcefn partial_cmp(&self, other: &H3Direction) -> Option<Ordering>
fn partial_cmp(&self, other: &H3Direction) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more