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
Provided Methods
sourcefn resolution(&self) -> u8
fn resolution(&self) -> u8
Gets the index resolution (0-15)
sourcefn direction(&self) -> H3Direction
fn direction(&self) -> H3Direction
Retrieves the direction of the current index
Panics
May panic if self
is invalid or has a resolution
of 0
sourcefn direction_checked(&self) -> Result<H3Direction, Error>
fn direction_checked(&self) -> Result<H3Direction, Error>
Retrieves the direction of the current index
Errors
May fail if self
is invalid or has a resolution
of 0
sourcefn direction_to_parent_resolution(
&self,
target_resolution: u8
) -> Result<H3Direction, Error>
fn direction_to_parent_resolution(
&self,
target_resolution: u8
) -> Result<H3Direction, Error>
Retrieves the direction of the current index relative to a parent at target_resolution