[][src]Struct semver_constraints::Range

pub struct Range { /* fields omitted */ }

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 Versions 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 Ranges 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]

impl Clone for 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_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl FromStr for Range[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Range

impl Sync for Range

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]