pub fn probe_reply(url: &str, root: &Path, timeout: Duration) -> Option<Value>Expand description
probe, keeping what the server answered: its index document when it answers as the
leaseholder of this checkout, None otherwise. One decision, so a caller that also wants
the surfaces the server lists makes neither a second request nor a second judgement.
use majordomus_cli::lease::probe_reply;
use std::time::Duration;
// nothing listens on port 1 of the loopback address
let root = std::path::Path::new("/r");
assert!(probe_reply("http://127.0.0.1:1", root, Duration::from_millis(50)).is_none());