pub enum VersionComparison {
LessOrEqual,
GreaterOrEqual,
Equal,
Less,
Greater,
}
Expand description
Specifies the comparison function for a VersionRequirement
.
The package version can be required to be:
- less than (
<
) - less than or equal to (
<=
) - equal to (
=
) - greater than or equal to (
>=
) - greater than (
>
)
the specified version.
§Note
The variants of this enum are sorted in a way, that prefers the two-letter comparators over
the one-letter ones.
This is because when splitting a string on the string representation of VersionComparison
variant and relying on the ordering of [strum::EnumIter
], the two-letter comparators must be
checked before checking the one-letter ones to yield robust results.
Variants§
Implementations§
source§impl VersionComparison
impl VersionComparison
sourcefn is_compatible_with(self, ord: Ordering) -> bool
fn is_compatible_with(self, ord: Ordering) -> bool
Returns true
if the result of a comparison between the actual and required package
versions satisfies the comparison function.
Trait Implementations§
source§impl AsRef<str> for VersionComparison
impl AsRef<str> for VersionComparison
source§impl Clone for VersionComparison
impl Clone for VersionComparison
source§fn clone(&self) -> VersionComparison
fn clone(&self) -> VersionComparison
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for VersionComparison
impl Debug for VersionComparison
source§impl Display for VersionComparison
impl Display for VersionComparison
source§impl FromStr for VersionComparison
impl FromStr for VersionComparison
source§impl IntoEnumIterator for VersionComparison
impl IntoEnumIterator for VersionComparison
type Iterator = VersionComparisonIter
fn iter() -> VersionComparisonIter ⓘ
source§impl PartialEq for VersionComparison
impl PartialEq for VersionComparison
source§impl TryFrom<&str> for VersionComparison
impl TryFrom<&str> for VersionComparison
source§impl VariantNames for VersionComparison
impl VariantNames for VersionComparison
impl Copy for VersionComparison
impl Eq for VersionComparison
impl StructuralPartialEq for VersionComparison
Auto Trait Implementations§
impl Freeze for VersionComparison
impl RefUnwindSafe for VersionComparison
impl Send for VersionComparison
impl Sync for VersionComparison
impl Unpin for VersionComparison
impl UnwindSafe for VersionComparison
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)