SemVer version requirement describing the intersection of some version
comparators, such as
*(meaning “any”), or one or more comma-separated comparators.
Build metadata is syntactically permitted on the partial versions, but is completely ignored, as it’s never relevant to whether any comparator matches a particular version.
Whitespace is permitted around commas and around operators. Whitespace is not permitted within a partial version, i.e. anywhere between the major version number and its minor, patch, pre-release, or build metadata.
VersionReq with no constraint on the version numbers it matches.
In terms of comparators this is equivalent to
* VersionReq does not match every possible
version number. In particular, in order for any
VersionReq to match
a pre-release version, the
VersionReq must contain at least one
Comparator that has an explicit major, minor, and patch version
identical to the pre-release being matched, and that has a nonempty
pre-release component. Since
* is not written with an explicit major,
minor, and patch version, and does not contain a nonempty pre-release
component, it does not match any pre-release versions.
VersionReq by parsing from string representation.
Possible reasons for the parse to fail include:
>a.b— unexpected characters in the partial version.
@1.0.0— unrecognized comparison operator.
^1.0.0,— unexpected end of input.
>=1.0 <2.0— missing comma between comparators.
*.*— unsupported wildcard syntax.
Evaluate whether the given
Version satisfies the version requirement
The default VersionReq is the same as
sto return a value of this type. Read more
othervalues to be equal, and is used by
!=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Auto Trait Implementations§
Returns the argument unchanged.