pub struct Search<G: Graph> { /* private fields */ }
Expand description
The search algorithm.
Implementations§
Source§impl<G: Graph> Search<G>
impl<G: Graph> Search<G>
Sourcepub fn new(graph: G, search_nodes: impl IntoIterator<Item = G::Node>) -> Self
pub fn new(graph: G, search_nodes: impl IntoIterator<Item = G::Node>) -> Self
Construct a new search. The provided graph
represents the universe of
all nodes, and nodes
represents a subset of that universe to search
in. Only elements from nodes
will be returned by success_bounds
and
failure_bounds
.
For example, graph
might correspond to the entire source control
directed acyclic graph, and nodes
might correspond to a recent range
of commits where the first one is passing and the last one is failing.
Sourcepub fn success_bounds(&self) -> Result<HashSet<G::Node>, G::Error>
pub fn success_bounds(&self) -> Result<HashSet<G::Node>, G::Error>
Get the currently known bounds on the success nodes.
FIXME: O(n) complexity.
Sourcepub fn failure_bounds(&self) -> Result<HashSet<G::Node>, G::Error>
pub fn failure_bounds(&self) -> Result<HashSet<G::Node>, G::Error>
Get the currently known bounds on the failure nodes.
FIXME: O(n) complexity.
Sourcepub fn search<'a, S: Strategy<G>>(
&'a self,
strategy: &'a S,
) -> Result<LazySolution<'_, G::Node, SearchError<G::Node, G::Error, S::Error>>, SearchError<G::Node, G::Error, S::Error>>
pub fn search<'a, S: Strategy<G>>( &'a self, strategy: &'a S, ) -> Result<LazySolution<'_, G::Node, SearchError<G::Node, G::Error, S::Error>>, SearchError<G::Node, G::Error, S::Error>>
Summarize the current search progress and suggest the next node(s) to
search. The caller is responsible for calling notify
with the result.
Trait Implementations§
Auto Trait Implementations§
impl<G> Freeze for Search<G>where
G: Freeze,
impl<G> RefUnwindSafe for Search<G>
impl<G> Send for Search<G>
impl<G> Sync for Search<G>
impl<G> Unpin for Search<G>
impl<G> UnwindSafe for Search<G>
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