Struct CachedFwdGraph
pub struct CachedFwdGraph<NK, Node, Edge> { /* private fields */ }Expand description
A forwarding graph can be registered with multiple plugins to verify different requirements.
An report is an execution result of a plugin. CachedFwdGraph cache reports of first executions of a plugins.
Methods from Deref<Target = Acyclic<Graph<Node, Edge>>>§
Sourcepub fn get_position<'a>(
&'a self,
id: <G as GraphBase>::NodeId,
) -> TopologicalPosition
pub fn get_position<'a>( &'a self, id: <G as GraphBase>::NodeId, ) -> TopologicalPosition
Get the position of a node in the topological sort.
Panics if the node index is out of bounds.
Sourcepub fn at_position(
&self,
pos: TopologicalPosition,
) -> Option<<G as GraphBase>::NodeId>
pub fn at_position( &self, pos: TopologicalPosition, ) -> Option<<G as GraphBase>::NodeId>
Get the node at a given position in the topological sort, if it exists.
Sourcepub fn nodes_iter(&self) -> impl Iterator<Item = <G as GraphBase>::NodeId>
pub fn nodes_iter(&self) -> impl Iterator<Item = <G as GraphBase>::NodeId>
Get an iterator over the nodes, ordered by their position.
Sourcepub fn range<'r>(
&'r self,
range: impl RangeBounds<TopologicalPosition> + 'r,
) -> impl Iterator<Item = <G as GraphBase>::NodeId> + 'r
pub fn range<'r>( &'r self, range: impl RangeBounds<TopologicalPosition> + 'r, ) -> impl Iterator<Item = <G as GraphBase>::NodeId> + 'r
Get an iterator over the nodes within the range of positions.
The nodes are ordered by their position in the topological sort.
Sourcepub fn try_add_edge(
&mut self,
a: <G as GraphBase>::NodeId,
b: <G as GraphBase>::NodeId,
weight: <G as Data>::EdgeWeight,
) -> Result<<G as GraphBase>::EdgeId, AcyclicEdgeError<<G as GraphBase>::NodeId>>
pub fn try_add_edge( &mut self, a: <G as GraphBase>::NodeId, b: <G as GraphBase>::NodeId, weight: <G as Data>::EdgeWeight, ) -> Result<<G as GraphBase>::EdgeId, AcyclicEdgeError<<G as GraphBase>::NodeId>>
Add an edge to the graph using Build::add_edge.
Returns the id of the added edge, or an AcyclicEdgeError if the edge
would create a cycle, a self-loop or if the edge addition failed in
the underlying graph.
In cases where edge addition using Build::add_edge cannot fail in
the underlying graph (e.g. when multi-edges are allowed, as in
DiGraph and StableDiGraph), this will return an error if and
only if Self::is_valid_edge returns false.
Note that for some graph types, the semantics of Build::add_edge may
not coincide with the semantics of the add_edge method provided by the
graph type.
Panics if a or b are not found.
Sourcepub fn try_update_edge(
&mut self,
a: <G as GraphBase>::NodeId,
b: <G as GraphBase>::NodeId,
weight: <G as Data>::EdgeWeight,
) -> Result<<G as GraphBase>::EdgeId, AcyclicEdgeError<<G as GraphBase>::NodeId>>
pub fn try_update_edge( &mut self, a: <G as GraphBase>::NodeId, b: <G as GraphBase>::NodeId, weight: <G as Data>::EdgeWeight, ) -> Result<<G as GraphBase>::EdgeId, AcyclicEdgeError<<G as GraphBase>::NodeId>>
Add or update an edge in a graph using Build::update_edge.
Returns the id of the updated edge, or an AcyclicEdgeError if the edge
would create a cycle or a self-loop. If the edge does not exist, the
edge is created.
This will return an error if and only if Self::is_valid_edge returns
false.
Panics if a or b are not found.
Sourcepub fn is_valid_edge(
&self,
a: <G as GraphBase>::NodeId,
b: <G as GraphBase>::NodeId,
) -> bool
pub fn is_valid_edge( &self, a: <G as GraphBase>::NodeId, b: <G as GraphBase>::NodeId, ) -> bool
Check if an edge would be valid, i.e. adding it would not create a cycle.
Panics if a or b are not found.
Sourcepub fn remove_edge(
&mut self,
e: <Graph<N, E, Directed, Ix> as GraphBase>::EdgeId,
) -> Option<E>
pub fn remove_edge( &mut self, e: <Graph<N, E, Directed, Ix> as GraphBase>::EdgeId, ) -> Option<E>
Remove an edge and return its edge weight, or None if it didn’t exist.
Pass through to underlying graph.
Sourcepub fn remove_node(
&mut self,
n: <Graph<N, E, Directed, Ix> as GraphBase>::NodeId,
) -> Option<N>
pub fn remove_node( &mut self, n: <Graph<N, E, Directed, Ix> as GraphBase>::NodeId, ) -> Option<N>
Remove a node from the graph if it exists, and return its weight. If it doesn’t exist in the graph, return None.
This updates the order in O(v) runtime and removes the node in the underlying graph.
Trait Implementations§
§impl<NK, Node, Edge> Deref for CachedFwdGraph<NK, Node, Edge>
impl<NK, Node, Edge> Deref for CachedFwdGraph<NK, Node, Edge>
§impl<NK, Node, Edge> DerefMut for CachedFwdGraph<NK, Node, Edge>
impl<NK, Node, Edge> DerefMut for CachedFwdGraph<NK, Node, Edge>
§fn deref_mut(
&mut self,
) -> &mut <CachedFwdGraph<NK, Node, Edge> as Deref>::Target
fn deref_mut( &mut self, ) -> &mut <CachedFwdGraph<NK, Node, Edge> as Deref>::Target
impl<NK, Node, Edge> Sync for CachedFwdGraph<NK, Node, Edge>
Auto Trait Implementations§
impl<NK, Node, Edge> !Freeze for CachedFwdGraph<NK, Node, Edge>
impl<NK, Node, Edge> !RefUnwindSafe for CachedFwdGraph<NK, Node, Edge>
impl<NK, Node, Edge> Send for CachedFwdGraph<NK, Node, Edge>
impl<NK, Node, Edge> Unpin for CachedFwdGraph<NK, Node, Edge>
impl<NK, Node, Edge> !UnwindSafe for CachedFwdGraph<NK, Node, Edge>
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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>
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>
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.