#[non_exhaustive]pub enum VersError {
Show 15 variants
TooLong,
Scheme,
Type,
Empty,
Whitespace,
EmptyConstraint,
LeadingEquals,
EmptyVersion,
Asterisk,
Encoding,
UnsupportedType,
NotSemver,
Order,
Sequence,
NotPep440,
}Expand description
Why a string is not a valid vers range, or could not be evaluated.
Experimental: may change in a 0.x minor release.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooLong
Longer than MAX_VERS_BYTES.
Scheme
The scheme is missing or is not lowercase vers.
Type
The type is missing, not lowercase, does not start with a letter, or
has characters other than ASCII letters, digits, . and -.
Empty
Nothing after vers:<type>/.
Whitespace
Literal ASCII whitespace anywhere in the string, or a decoded version with whitespace other than a space.
EmptyConstraint
A leading, trailing or repeated |.
LeadingEquals
A constraint starts with =; equality is a bare version.
EmptyVersion
A comparator with no version after it.
Asterisk
* together with other constraints, or * followed by a version.
Encoding
A % not followed by two hex digits, decoded bytes that are not UTF-8,
or an unencoded character the specification reserves.
UnsupportedType
The type is not one the evaluating method handles (SemVer types for
VersRange::contains_semver, pypi for VersRange::contains_pypi).
NotSemver
A constraint version is not a SemVer 2.0 version.
Order
Constraints are not sorted by version, or a version occurs twice.
Sequence
Comparators do not alternate between lower and upper bounds.
NotPep440
A constraint version of a pypi range is not a PEP 440 version.
Trait Implementations§
impl Eq for VersError
Source§impl Error for VersError
impl Error for VersError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()