pub trait Index: Sized + PartialEq + FromH3Index {
    fn h3index(&self) -> H3Index;
    fn new(h3index: H3Index) -> Self;
    fn validate(&self) -> Result<(), Error>;

    fn resolution(&self) -> u8 { ... }
    fn is_valid(&self) -> bool { ... }
    fn direction(&self) -> H3Direction { ... }
    fn direction_checked(&self) -> Result<H3Direction, Error> { ... }
    fn direction_to_parent_resolution(
        &self,
        target_resolution: u8
    ) -> Result<H3Direction, Error> { ... } }
Expand description

Trait to handle types having a H3 Index like cells and edges

Required Methods

Get the u64 H3 Index address

create an index from the given u64.

No validation is performed.

Checks the validity of the index

Provided Methods

Gets the index resolution (0-15)

Checks the validity of the index

Retrieves the direction of the current index

Panics

May panic if self is invalid or has a resolution of 0

Retrieves the direction of the current index

Errors

May fail if self is invalid or has a resolution of 0

Retrieves the direction of the current index relative to a parent at target_resolution

Implementors