Skip to main content

is_run_id_prefix

Function is_run_id_prefix 

Source
pub fn is_run_id_prefix(s: &str) -> bool
Expand description

True iff s is a syntactically valid (possibly partial) prefix of a RunId: non-empty, no longer than a full ULID, every character a lowercase Crockford base32 digit, and a first character within ULID’s 0..=7 timestamp bound. Used by the CLI to resolve an unambiguous run-id prefix (like git) — a value failing this is a malformed argument (invalid_run_id), not a legitimate-but-unknown prefix. The first-char bound is enforced because no valid RunId can begin outside 0..=7, so an 8…/9… prefix is impossible rather than merely absent — reporting it as malformed keeps the error class honest and consistent with how RunId::parse_str rejects a full-length id with the same leading digit.