pub enum Pin {
Exact,
Minimum,
}Expand description
What a declared version asks of the installed one. A .nvmrc that says 22 pins a
release line; a rust-version of 1.85 is a floor that 1.90 satisfies. Reading the
second as the first reports every up-to-date machine as wrong.
The same pair of versions answers differently under each pin:
use majordomus_cli::environment::toolchain::{satisfies, Pin};
// a newer release satisfies a floor but not a pinned release line
assert_eq!(satisfies("1.85", "1.90.0", Pin::Minimum), Some(true));
assert_eq!(satisfies("1.85", "1.90.0", Pin::Exact), Some(false));
// a release inside the pinned line satisfies both
assert_eq!(satisfies("22", "22.20.0", Pin::Exact), Some(true));
assert_eq!(satisfies("22", "22.20.0", Pin::Minimum), Some(true));Variants§
Exact
The installed version starts with the declared one, component by component.
Minimum
The installed version is at least the declared one.
Trait Implementations§
impl Copy for Pin
impl Eq for Pin
impl StructuralPartialEq for Pin
Auto Trait Implementations§
impl Freeze for Pin
impl RefUnwindSafe for Pin
impl Send for Pin
impl Sync for Pin
impl Unpin for Pin
impl UnsafeUnpin for Pin
impl UnwindSafe for Pin
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.