/// Returns a `Strategy` that generates random dependency links from this graph.
///
/// Requires the `proptest1` feature to be enabled.
///
/// ## Panics
///
/// Panics if there are no dependency edges in this `PackageGraph`.
Returns a `Strategy` that generates random dependency links from this graph.
Requires the `proptest1` feature to be enabled.
Returns a ` Strategy ` that generates random dependency links from this graph . Requires the ` proptest1 ` feature to be enabled .
pub fn prop010_link_strategy(&self) -> impl Strategy<Value = PackageLink<'_>> {
        any::<prop::sample::Index>().prop_map(move |index| {
            // Note that this works because PackageGraph uses petgraph::Graph, not StableGraph. If
            // PackageGraph used StableGraph, a retain_edges call would create holes -- invalid
            // indexes in the middle of the range. Graph compacts edge indexes so that all
            // indexes from 0 to link_count are valid.
            let edge_ix = EdgeIndex::new(index.index(self.link_count()));
            self.edge_ix_to_link(edge_ix)
        })
    }
pub fn prop010_link_strategy ( & self ) -> impl Strategy < Value = PackageLink < ' _ > > { any :: < prop :: sample :: Index > ( ) . prop_map ( move | index | { // Note that this works because PackageGraph uses petgraph::Graph, not StableGraph. If // PackageGraph used StableGraph, a retain_edges call would create holes -- invalid // indexes in the middle of the range. Graph compacts edge indexes so that all // indexes from 0 to link_count are valid. let edge_ix = EdgeIndex :: new ( index . index ( self . link_count ( ) ) ) ; self . edge_ix_to_link ( edge_ix ) } ) }
Returns a `Strategy` that generates random dependency links from this graph.
Returns a ` Strategy ` that generates random dependency links from this graph .
&self
panics
Panics if there are no dependency edges in this `PackageGraph`.
Panics if there are no dependency edges in this ` PackageGraph ` .