#[non_exhaustive]pub enum SearchOutcome<P, S> {
Found {
path: P,
stats: S,
},
NoPath {
stats: S,
},
}Expand description
Successful search computation, separate from request validation failures.
Found and NoPath both carry stats so callers can compare effort even when
no route exists. Domain-specific input validation remains an outer Err in
each owner crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Found
A route was found together with algorithm-defined work statistics.
Fields
path: PDomain path value (grid path, free-space polyline, corridor path, …).
stats: SAlgorithm-defined work counters for this successful search.
NoPath
Exhaustive search found no route, but still produced work statistics.
Fields
stats: SAlgorithm-defined work counters for the exhaustive no-path search.
Implementations§
Source§impl<P, S> SearchOutcome<P, S>
impl<P, S> SearchOutcome<P, S>
Sourcepub const fn found(path: P, stats: S) -> SearchOutcome<P, S>
pub const fn found(path: P, stats: S) -> SearchOutcome<P, S>
Successful route with work stats (not a validation error).
Sourcepub const fn no_path(stats: S) -> SearchOutcome<P, S>
pub const fn no_path(stats: S) -> SearchOutcome<P, S>
Exhaustive search found no route; still carries work stats for comparison.
Sourcepub const fn is_found(&self) -> bool
pub const fn is_found(&self) -> bool
Whether this outcome is Self::Found (validation failures are outer Err).
Sourcepub const fn path(&self) -> Option<&P>
pub const fn path(&self) -> Option<&P>
Path when found; None for Self::NoPath.
Source§impl<P, S> SearchOutcome<P, S>where
P: SearchPathCost,
impl<P, S> SearchOutcome<P, S>where
P: SearchPathCost,
Sourcepub fn cost(&self) -> Option<<P as SearchPathCost>::Cost>
pub fn cost(&self) -> Option<<P as SearchPathCost>::Cost>
Path cost when found; None for no-path outcomes.
Source§impl<P, S> SearchOutcome<P, S>where
S: SearchVisitStats,
impl<P, S> SearchOutcome<P, S>where
S: SearchVisitStats,
Sourcepub fn visited_nodes(&self) -> usize
pub fn visited_nodes(&self) -> usize
Algorithm-defined visit count from either found or no-path stats.
Trait Implementations§
Source§impl<P, S> Clone for SearchOutcome<P, S>
impl<P, S> Clone for SearchOutcome<P, S>
Source§fn clone(&self) -> SearchOutcome<P, S>
fn clone(&self) -> SearchOutcome<P, S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more