Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@

## Summary

<!-- Here goes a general summary of what this release is about -->

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->

## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
This is the first release of the Frequenz Component Graph. In this version, it supports validating component graphs, provides formula generators for various metrics and methods for manual traversal of the graph, when necessary.
15 changes: 9 additions & 6 deletions src/graph/retrieval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ where
}

/// Returns an iterator over the components in the graph.
pub fn components(&self) -> Components<N> {
pub fn components(&self) -> Components<'_, N> {
Components {
iter: self.graph.raw_nodes().iter(),
}
}

/// Returns an iterator over the connections in the graph.
pub fn connections(&self) -> Connections<N, E> {
pub fn connections(&self) -> Connections<'_, N, E> {
Connections {
cg: self,
iter: self.graph.raw_edges().iter(),
Expand All @@ -42,7 +42,7 @@ where
/// given `component_id`.
///
/// Returns an error if the given `component_id` does not exist.
pub fn predecessors(&self, component_id: u64) -> Result<Neighbors<N>, Error> {
pub fn predecessors(&self, component_id: u64) -> Result<Neighbors<'_, N>, Error> {
self.node_indices
.get(&component_id)
.map(|&index| Neighbors {
Expand All @@ -60,7 +60,7 @@ where
/// given `component_id`.
///
/// Returns an error if the given `component_id` does not exist.
pub fn successors(&self, component_id: u64) -> Result<Neighbors<N>, Error> {
pub fn successors(&self, component_id: u64) -> Result<Neighbors<'_, N>, Error> {
self.node_indices
.get(&component_id)
.map(|&index| Neighbors {
Expand All @@ -81,7 +81,7 @@ where
pub(crate) fn siblings_from_predecessors(
&self,
component_id: u64,
) -> Result<Siblings<N>, Error> {
) -> Result<Siblings<'_, N>, Error> {
Ok(Siblings::new(
component_id,
self.predecessors(component_id)?
Expand All @@ -96,7 +96,10 @@ where
/// given `component_id`, that have shared successors.
///
/// Returns an error if the given `component_id` does not exist.
pub(crate) fn siblings_from_successors(&self, component_id: u64) -> Result<Siblings<N>, Error> {
pub(crate) fn siblings_from_successors(
&self,
component_id: u64,
) -> Result<Siblings<'_, N>, Error> {
Ok(Siblings::new(
component_id,
self.successors(component_id)?
Expand Down