pub struct VersionRange { /* private fields */ }Expand description
An inclusive implementation-version range attached to compatibility evidence.
Implementations§
Source§impl VersionRange
impl VersionRange
Sourcepub const fn from_minimum(minimum: ImplementationVersion) -> Self
pub const fn from_minimum(minimum: ImplementationVersion) -> Self
Creates a range with an inclusive minimum and no maximum.
Sourcepub const fn exact(version: ImplementationVersion) -> Self
pub const fn exact(version: ImplementationVersion) -> Self
Creates a range containing one exact version.
Sourcepub fn new(
minimum: Option<ImplementationVersion>,
maximum: Option<ImplementationVersion>,
) -> Result<Self, InvalidVersionRange>
pub fn new( minimum: Option<ImplementationVersion>, maximum: Option<ImplementationVersion>, ) -> Result<Self, InvalidVersionRange>
Creates a checked inclusive range.
§Errors
Returns InvalidVersionRange when both bounds exist and the minimum is newer than the
maximum.
Sourcepub const fn minimum(self) -> Option<ImplementationVersion>
pub const fn minimum(self) -> Option<ImplementationVersion>
Returns the inclusive minimum.
Sourcepub const fn maximum(self) -> Option<ImplementationVersion>
pub const fn maximum(self) -> Option<ImplementationVersion>
Returns the inclusive maximum.
Sourcepub fn contains(self, version: ImplementationVersion) -> bool
pub fn contains(self, version: ImplementationVersion) -> bool
Reports whether an exact version is inside the inclusive range.
Trait Implementations§
Source§impl Clone for VersionRange
impl Clone for VersionRange
Source§fn clone(&self) -> VersionRange
fn clone(&self) -> VersionRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for VersionRange
Source§impl Debug for VersionRange
impl Debug for VersionRange
Source§impl Default for VersionRange
impl Default for VersionRange
Source§fn default() -> VersionRange
fn default() -> VersionRange
Returns the “default value” for a type. Read more
impl Eq for VersionRange
Source§impl Hash for VersionRange
impl Hash for VersionRange
Source§impl PartialEq for VersionRange
impl PartialEq for VersionRange
impl StructuralPartialEq for VersionRange
Auto Trait Implementations§
impl Freeze for VersionRange
impl RefUnwindSafe for VersionRange
impl Send for VersionRange
impl Sync for VersionRange
impl Unpin for VersionRange
impl UnsafeUnpin for VersionRange
impl UnwindSafe for VersionRange
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