Skip to main content

parse_version_answer

Function parse_version_answer 

Source
pub fn parse_version_answer(text: &str) -> Option<DogVersion>
Expand description

Parses the format docs/dogs.md publishes: <name> <version> on line 1, then <key>: <value> lines.

None when there is no line 1 to read a version from. Everything past that is tolerated rather than refused: unknown keys, blank lines, key order, and a shep-protocol that is not a number, because a shep that refuses a dog over the shape of text the dog never promised to print is refusing on its own guess. The strictness is all in the other direction: only an exact SHEP_PROTOCOL_KEY carrying a decimal is believed, and only a believed protocol can refuse.