Trait h3ron::Index[][src]

pub trait Index: Sized + PartialEq {
    fn h3index(&self) -> H3Index;
fn new(h3index: H3Index) -> Self;
fn validate(&self) -> Result<(), Error>; fn resolution(&self) -> u8 { ... }
fn is_valid(&self) -> bool { ... }
fn is_parent_of(&self, other: &Self) -> bool { ... }
fn is_child_of(&self, other: &Self) -> bool { ... }
fn contains(&self, other: &Self) -> bool { ... }
fn get_parent(&self, parent_resolution: u8) -> Result<Self, Error> { ... }
fn get_parent_unchecked(&self, parent_resolution: u8) -> Self { ... }
fn get_children(&self, child_resolution: u8) -> Vec<Self> { ... } }
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

Checks if self is a parent of other

Checks if other is a parent of self

Checks if self is a parent of other

Retrieves the parent index at parent_resolution.

Returns

This method may fail if the parent_resolution is higher than current self resolution.

If you don’t want it to fail use get_parent_unchecked

Retrieves the parent index at parent_resolution.

Returns

This method may return an invalid Index if the parent_resolutionis higher than current self resolution.

Use get_parent for validity check.

Retrieves all children of self at resolution child_resolution

Implementors