Skip to main content

cached_version

Function cached_version 

Source
pub(crate) async fn cached_version<F, Fut>(cli_path: &str, probe: F) -> String
where F: FnOnce() -> Fut, Fut: Future<Output = Option<String>>,
Expand description

The version of the CLI at cli_path: cached while the file is unchanged, and asked for by one probe at a time (callers for the same file wait for it). probe returns None when it couldn’t read one; that answers UNKNOWN and is never cached. A path with no file behind it (a bare command name) is probed every time.