pub struct H3EdgeGraph<W> {
pub edges: H3EdgeMap<W>,
pub h3_resolution: u8,
}
Fields§
§edges: H3EdgeMap<W>
§h3_resolution: u8
Implementations§
Source§impl<W> H3EdgeGraph<W>
impl<W> H3EdgeGraph<W>
pub fn new(h3_resolution: u8) -> Self
Sourcepub fn num_nodes(&self) -> Result<usize, Error>
pub fn num_nodes(&self) -> Result<usize, Error>
This has to generate the node list first, so its rather expensive to call.
pub fn num_edges(&self) -> usize
pub fn edge_weight(&self, edge: &H3DirectedEdge) -> Option<&W>
Sourcepub fn edges_from_cell(
&self,
cell: &H3Cell,
) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
pub fn edges_from_cell( &self, cell: &H3Cell, ) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
get all edges in the graph leading from this edge to neighbors
Sourcepub fn edges_to_cell(
&self,
cell: &H3Cell,
) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
pub fn edges_to_cell( &self, cell: &H3Cell, ) -> Result<Vec<(&H3DirectedEdge, &W)>, Error>
get all edges in the graph leading to this cell from its neighbors
pub fn add_edge_using_cells( &mut self, cell_from: H3Cell, cell_to: H3Cell, weight: W, ) -> Result<(), Error>
pub fn add_edge_using_cells_bidirectional( &mut self, cell_from: H3Cell, cell_to: H3Cell, weight: W, ) -> Result<(), Error>
pub fn add_edge(&mut self, edge: H3DirectedEdge, weight: W) -> Result<(), Error>
pub fn try_add(&mut self, other: Self) -> Result<(), Error>
Sourcepub fn nodes(&self) -> Result<H3CellMap<NodeType>, Error>
pub fn nodes(&self) -> Result<H3CellMap<NodeType>, Error>
cells which are valid targets to route to
This is a rather expensive operation as nodes are not stored anywhere and need to be extracted from the edges.
pub fn iter_edges(&self) -> impl Iterator<Item = (H3DirectedEdge, &W)>
Trait Implementations§
Source§impl<W: Clone> Clone for H3EdgeGraph<W>
impl<W: Clone> Clone for H3EdgeGraph<W>
Source§fn clone(&self) -> H3EdgeGraph<W>
fn clone(&self) -> H3EdgeGraph<W>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<W> CoveredArea for H3EdgeGraph<W>
impl<W> CoveredArea for H3EdgeGraph<W>
type Error = Error
Source§fn covered_area(
&self,
reduce_resolution_by: u8,
) -> Result<MultiPolygon<f64>, Self::Error>
fn covered_area( &self, reduce_resolution_by: u8, ) -> Result<MultiPolygon<f64>, Self::Error>
calculates a
MultiPolygon
of the area covered by a graph Read moreSource§impl<'de, W> Deserialize<'de> for H3EdgeGraph<W>where
W: Deserialize<'de>,
impl<'de, W> Deserialize<'de> for H3EdgeGraph<W>where
W: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<W> From<PreparedH3EdgeGraph<W>> for H3EdgeGraph<W>
impl<W> From<PreparedH3EdgeGraph<W>> for H3EdgeGraph<W>
Source§fn from(prepared_graph: PreparedH3EdgeGraph<W>) -> Self
fn from(prepared_graph: PreparedH3EdgeGraph<W>) -> Self
Converts to this type from the input type.
Source§impl<W> GetEdge for H3EdgeGraph<W>where
W: Copy,
impl<W> GetEdge for H3EdgeGraph<W>where
W: Copy,
type EdgeWeightType = W
fn get_edge( &self, edge: &H3DirectedEdge, ) -> Result<Option<EdgeWeight<'_, Self::EdgeWeightType>>, Error>
Source§impl<W> GetStats for H3EdgeGraph<W>
impl<W> GetStats for H3EdgeGraph<W>
Source§impl<W> HasH3Resolution for H3EdgeGraph<W>
impl<W> HasH3Resolution for H3EdgeGraph<W>
Source§fn h3_resolution(&self) -> u8
fn h3_resolution(&self) -> u8
Gets the index resolution (0-15)
Source§impl<W> Serialize for H3EdgeGraph<W>where
W: Serialize,
impl<W> Serialize for H3EdgeGraph<W>where
W: Serialize,
Source§impl<W> TryFrom<H3EdgeGraph<W>> for PreparedH3EdgeGraph<W>
impl<W> TryFrom<H3EdgeGraph<W>> for PreparedH3EdgeGraph<W>
Auto Trait Implementations§
impl<W> Freeze for H3EdgeGraph<W>
impl<W> RefUnwindSafe for H3EdgeGraph<W>where
W: RefUnwindSafe,
impl<W> Send for H3EdgeGraph<W>where
W: Send,
impl<W> Sync for H3EdgeGraph<W>where
W: Sync,
impl<W> Unpin for H3EdgeGraph<W>where
W: Unpin,
impl<W> UnwindSafe for H3EdgeGraph<W>where
W: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more