[−][src]Struct semver_constraints::Range
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 <=.
Methods
impl Range
[src]
pub fn new(lower: Interval, upper: Interval) -> Option<Range>
[src]
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
[src]
pub fn upper(&self) -> &Interval
[src]
pub fn lower(&self) -> &Interval
[src]
pub fn take(self) -> (Interval, Interval)
[src]
pub fn satisfies(&self, version: &Version) -> bool
[src]
Checks if a version is satisfied by this Range
.
Trait Implementations
impl PartialEq<Range> for Range
[src]
impl From<Version> for Range
[src]
impl From<Range> for Constraint
[src]
fn from(r: Range) -> Constraint
[src]
impl Clone for Range
[src]
fn clone(&self) -> Range
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Range
[src]
impl Display for Range
[src]
impl Debug for Range
[src]
impl Hash for Range
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for Range
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,