pub struct VersionRange { /* private fields */ }Expand description
Inclusive minimum and optional maximum target versions.
Implementations§
Source§impl VersionRange
impl VersionRange
Sourcepub const fn new(
minimum: PlatformVersion,
maximum: Option<PlatformVersion>,
) -> Result<Self, TargetProfileError>
pub const fn new( minimum: PlatformVersion, maximum: Option<PlatformVersion>, ) -> Result<Self, TargetProfileError>
Creates an inclusive version range.
§Errors
Returns TargetProfileError::MaximumBeforeMinimum for an inverted range.
Sourcepub const fn minimum(self) -> PlatformVersion
pub const fn minimum(self) -> PlatformVersion
Returns the inclusive minimum version.
Sourcepub const fn maximum(self) -> Option<PlatformVersion>
pub const fn maximum(self) -> Option<PlatformVersion>
Returns the inclusive optional maximum version.
Sourcepub const fn contains(self, version: PlatformVersion) -> bool
pub const fn contains(self, version: PlatformVersion) -> bool
Returns whether a 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
impl Eq 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