#[non_exhaustive]pub struct PinPattern {
pub match: String,
pub occurrences: Occurrences,
pub whole_line: bool,
}Expand description
One version spelling in a file, and how often the file may say it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.match: StringThe text around a version, {version} where the version is. Literal
text instead of a regex, so nothing about the file’s format is
assumed. Exactly one placeholder, checked over patterns so the
complaint names the id.
A side is bounded when the text between {version} and the pattern’s
edge contains a character that is not a digit, ., -, or +. The
character next to {version} must not be a digit, or a . with a
digit beyond it.
Under whole_line the line start or end bounds a side whose literal is
empty. The load refuses a pattern with an open side.
occurrences: OccurrencesHow often the file must say it. A pin that lost its only mention, or drifted to one nobody declared, fails the release rather than serving a stale version.
whole_line: boolWhether the match is a whole line rather than text inside one.
When unset, a pattern matches anywhere, which is what an inline
spelling needs: github:org/tool@1.2.3 is inside a longer line.
A pattern that owns its line sets this flag instead of anchoring on
whatever text happens to be next to it. The alternative is spelling the
neighbour into match, which then breaks when the neighbour moves.
The flag also makes a partial version fail instead of rewriting,
because a line ending in 0.1.1_local does not end where the version
does.