Struct node_semver::Range
source · [−]pub struct Range(_);
Expand description
Node-style semver range.
These ranges map mostly 1:1 to semver’s except for some internal representation details that allow some more interesting set-level operations.
For details on supported syntax, see https://github.com/npm/node-semver#advanced-range-syntax
Implementations
sourceimpl Range
impl Range
sourcepub fn parse<S: AsRef<str>>(input: S) -> Result<Self, SemverError>
pub fn parse<S: AsRef<str>>(input: S) -> Result<Self, SemverError>
Parse a range from a string.
sourcepub fn satisfies(&self, version: &Version) -> bool
pub fn satisfies(&self, version: &Version) -> bool
Returns true if version
is satisfied by this range.
sourcepub fn allows_all(&self, other: &Range) -> bool
pub fn allows_all(&self, other: &Range) -> bool
Returns true if other
is a strict superset of this range.
sourcepub fn allows_any(&self, other: &Range) -> bool
pub fn allows_any(&self, other: &Range) -> bool
Returns true if other
has overlap with this range.
sourcepub fn intersect(&self, other: &Self) -> Option<Self>
pub fn intersect(&self, other: &Self) -> Option<Self>
Returns a new range that is the set-intersection between this range and other
.
sourcepub fn difference(&self, other: &Self) -> Option<Self>
pub fn difference(&self, other: &Self) -> Option<Self>
Returns a new range that is the set-difference between this range and other
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Range
impl<'de> Deserialize<'de> for Range
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Range
impl StructuralEq for Range
impl StructuralPartialEq for Range
Auto Trait Implementations
impl RefUnwindSafe for Range
impl Send for Range
impl Sync for Range
impl Unpin for Range
impl UnwindSafe for Range
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more