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.
See alpm-comparison for details on the format.
§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§
LessOrEqual
Less than or equal to
GreaterOrEqual
Greater than or equal to
Equal
Equal to
Less
Less than
Greater
Greater than
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 AlpmParser for VersionComparison
impl AlpmParser for VersionComparison
Source§fn parser(input: &mut &str) -> ModalResult<Self>
fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a VersionComparison in a string slice.
§Errors
Returns an error if input does not begin with a valid alpm-comparison, or if
input begins with a valid alpm-comparison, but is then followed by any further
comparison character (<, >, =).
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VersionComparison
impl Debug for VersionComparison
Source§impl<'de> Deserialize<'de> for VersionComparison
impl<'de> Deserialize<'de> for VersionComparison
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for VersionComparison
impl Display for VersionComparison
Source§impl FromStr for VersionComparison
impl FromStr for VersionComparison
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a new VersionComparison from a string slice.
Delegates to VersionComparison::parser.
§Errors
Returns an error if VersionComparison::parser fails.
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§fn eq(&self, other: &VersionComparison) -> bool
fn eq(&self, other: &VersionComparison) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for VersionComparison
impl Serialize 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 UnsafeUnpin for VersionComparison
impl UnwindSafe for VersionComparison
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U> ParserUntil for Uwhere
U: AlpmParser,
impl<U> ParserUntil for Uwhere
U: AlpmParser,
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
§Note
Does not consume the delimiter.
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Source§impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
Source§fn parser_until_inclusive<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.