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<(DependencySpecificationOperator, &str)>
pub fn parse(input: &str) -> Option<(DependencySpecificationOperator, &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 FromStr for DependencySpecificationOperator
impl FromStr for DependencySpecificationOperator
Source§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
Source§fn from_str(
s: &str,
) -> Result<DependencySpecificationOperator, <DependencySpecificationOperator as FromStr>::Err>
fn from_str( s: &str, ) -> Result<DependencySpecificationOperator, <DependencySpecificationOperator as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§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
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
Source§fn try_from(
s: &str,
) -> Result<DependencySpecificationOperator, <DependencySpecificationOperator as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<DependencySpecificationOperator, <DependencySpecificationOperator as TryFrom<&str>>::Error>
Performs the conversion.
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§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<Main> IntoAttached for Main
impl<Main> IntoAttached for Main
Source§fn into_attached<Attachment>(
self,
attachment: Attachment,
) -> Attached<Self, Attachment>
fn into_attached<Attachment>( self, attachment: Attachment, ) -> Attached<Self, Attachment>
Attach metadata to an object.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Is for T
impl<T> Is for T
type Type = T
fn into_val(self) -> <T as Is>::Type
fn into_ref(&self) -> &<T as Is>::Type
fn into_mut_ref(&mut self) -> &mut <T as Is>::Type
fn from_val(x: <T as Is>::Type) -> T
fn from_ref(x: &<T as Is>::Type) -> &T
fn from_mut_ref(x: &mut <T as Is>::Type) -> &mut T
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