pub enum DependencySpecificationOperator {
Less = -2,
LessOrEqual = -1,
Equal = 0,
GreaterOrEqual = 1,
Greater = 2,
}Expand description
Operator at the start of a DependencySpecification.
Variants§
Implementations§
Source§impl DependencySpecificationOperator
impl DependencySpecificationOperator
Sourcepub fn parse(input: &str) -> Option<(Self, &str)>
pub fn parse(input: &str) -> Option<(Self, &str)>
Parse a dependency spec operator from an input string.
assert_eq!(
DependencySpecificationOperator::parse("<1.27.0-1"),
Some((DependencySpecificationOperator::Less, "1.27.0-1")),
);
assert_eq!(
DependencySpecificationOperator::parse("<=1.27.0-1"),
Some((DependencySpecificationOperator::LessOrEqual, "1.27.0-1")),
);
assert_eq!(
DependencySpecificationOperator::parse("=1.27.0-1"),
Some((DependencySpecificationOperator::Equal, "1.27.0-1")),
);
assert_eq!(
DependencySpecificationOperator::parse(">=1.27.0-1"),
Some((DependencySpecificationOperator::GreaterOrEqual, "1.27.0-1")),
);
assert_eq!(
DependencySpecificationOperator::parse(">1.27.0-1"),
Some((DependencySpecificationOperator::Greater, "1.27.0-1")),
);
assert_eq!(DependencySpecificationOperator::parse("1.27.0-1"), None);Trait Implementations§
Source§impl AsRef<str> for DependencySpecificationOperator
impl AsRef<str> for DependencySpecificationOperator
Source§impl Clone for DependencySpecificationOperator
impl Clone for DependencySpecificationOperator
Source§fn clone(&self) -> DependencySpecificationOperator
fn clone(&self) -> DependencySpecificationOperator
Returns a duplicate 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<'_derivative_strum> From<&'_derivative_strum DependencySpecificationOperator> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum DependencySpecificationOperator> for &'static str
Source§fn from(x: &'_derivative_strum DependencySpecificationOperator) -> &'static str
fn from(x: &'_derivative_strum DependencySpecificationOperator) -> &'static str
Converts to this type from the input type.
Source§impl From<DependencySpecificationOperator> for &'static str
impl From<DependencySpecificationOperator> for &'static str
Source§fn from(x: DependencySpecificationOperator) -> &'static str
fn from(x: DependencySpecificationOperator) -> &'static str
Converts to this type from the input type.
Source§impl PartialEq for DependencySpecificationOperator
impl PartialEq for DependencySpecificationOperator
Source§fn eq(&self, other: &DependencySpecificationOperator) -> bool
fn eq(&self, other: &DependencySpecificationOperator) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl TryFrom<&str> for DependencySpecificationOperator
impl TryFrom<&str> for DependencySpecificationOperator
impl Copy for DependencySpecificationOperator
impl Eq for DependencySpecificationOperator
impl StructuralPartialEq for DependencySpecificationOperator
Auto Trait Implementations§
impl Freeze for DependencySpecificationOperator
impl RefUnwindSafe for DependencySpecificationOperator
impl Send for DependencySpecificationOperator
impl Sync for DependencySpecificationOperator
impl Unpin for DependencySpecificationOperator
impl UnwindSafe for DependencySpecificationOperator
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<X> Pipe for X
impl<X> Pipe for X
Source§fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
Source§fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
Source§fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait AsRef<Param>. Read moreSource§fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait AsMut<Param>. Read moreSource§fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Deref<Target = Param>. Read moreSource§fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait DerefMut<Target = Param>. Read moreSource§fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Borrow<Param>. Read moreSource§fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Return
fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function, ) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait BorrowMut<Param>. Read more