Struct version_lp::Version
source · pub struct Version { /* private fields */ }
Implementations
sourceimpl Version
impl Version
sourcepub fn new_wildcard() -> Version
pub fn new_wildcard() -> Version
creates a new wildcard version,“*”, which matches compatible with everything
sourcepub fn from_latest_vec(list: &Vec<String>) -> Option<Version>
pub fn from_latest_vec(list: &Vec<String>) -> Option<Version>
returns the largest number in the list of strings assumes they all aren’t wildcards (doesn’t process wildcards, just skips them from the list)
pub fn latest_compatible<'a>(&self, list: &'a Vec<String>) -> Option<&'a str>
pub fn latest_compatible_version<'a>(
&self,
list: &'a Vec<Version>
) -> Option<&'a Version>
sourcepub fn has_wildcards(&self) -> bool
pub fn has_wildcards(&self) -> bool
checks if the version has a wildcard in it
sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
returns true if 100% wild
sourcepub fn is_compatible_with(&self, other: &Version) -> bool
pub fn is_compatible_with(&self, other: &Version) -> bool
checks compatibility between versions
uses wildcards in the comparision. if the self
version has wildcards then it will not be compatible with anything else since it is not an actual version
sourcepub fn to_string_serializer(&self) -> String
pub fn to_string_serializer(&self) -> String
returns a string formated as “x_x_x_x”
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
sourcefn deserialize<D>(deserializer: D) -> Result<Version, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Version, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Version
impl Ord for Version
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Version> for Version
impl PartialEq<Version> for Version
sourceimpl PartialOrd<Version> for Version
impl PartialOrd<Version> for Version
sourcefn partial_cmp(&self, other: &Version) -> Option<Ordering>
fn partial_cmp(&self, other: &Version) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Version
Auto Trait Implementations
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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