pub struct Range { /* private fields */ }
Expand description
A continguous range in which a version can fall into. Syntax for ranges mirrors that of
Pub or Cargo. Ranges can accept caret and tilde syntax, as well as less-than/greater-than
specifications (just like Cargo). Like Pub, the any
Range is completely unbounded on
both sides. Pre-release Version
s can satisfy a Range
iff the Range
mentions a pre-release Version
on either bound, or if the Range
is unbounded on the upper
side. Additionally, if a greater-than and/or less-than Range
also has a !
after the
inequality symbol, the Range will include pre-release versions. >=! 1.0.0
accepts all
pre-releases of 1.0.0, along with the greater versions. <! 2.0.0
includes pre-releases of
2.0.0. >! and > mean the same thing, as do <=! and <=.
Implementations§
Source§impl Range
impl Range
Sourcepub fn new(lower: Interval, upper: Interval) -> Option<Range>
pub fn new(lower: Interval, upper: Interval) -> Option<Range>
Creates a new Range
.
All Range
s have to be valid, potentially true constraints. If a nonsensical range is
suggested, None
is returned.
pub fn any() -> Range
pub fn upper(&self) -> &Interval
pub fn lower(&self) -> &Interval
pub fn take(self) -> (Interval, Interval)
Trait Implementations§
Source§impl From<Range> for Constraint
impl From<Range> for Constraint
Source§fn from(r: Range) -> Constraint
fn from(r: Range) -> Constraint
impl Eq for Range
impl StructuralPartialEq for Range
Auto Trait Implementations§
impl Freeze for Range
impl RefUnwindSafe for Range
impl Send for Range
impl Sync for Range
impl Unpin for Range
impl UnwindSafe for Range
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
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
key
and return true
if they are equal.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>
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>
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 more