1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Evaluate binary path stability and find stable PATH candidates.
//!
//! This library analyzes binary paths, tags them with observed attributes
//! (version manager, build output, ephemeral, shim, etc.), judges their
//! [`Durability`] (whether a path can be pinned into a service definition),
//! and ranks them to find the most suitable candidate for use in service
//! registration, configuration files, or scripts.
//!
//! # Quick Start
//!
//! ```no_run
//! use stable_which::{find_candidates, rank_candidates, ScoringPolicy};
//! use std::path::Path;
//!
//! let mut candidates = find_candidates(Path::new("jj")).unwrap();
//! rank_candidates(&mut candidates, ScoringPolicy::SameBinary);
//! println!("Best: {}", candidates[0].path().display());
//! ```
//!
//! # API layering
//!
//! The public surface separates three concerns:
//!
//! - [`find_candidates`] / [`find_candidates_with_path_env`] — *discovery only*,
//! returns candidates in deterministic (PATH discovery) order.
//! - [`rank_candidates`] — sorts a candidate slice in place by a
//! [`ScoringPolicy`].
//! - [`resolve_stable_path`] — the convenience composition of find + rank that
//! returns the single best candidate.
// Re-export the primary types and functions. The module structure itself is an
// implementation detail; consumers reference everything from the crate root.
pub use ;
pub use Durability;