pub struct VersionUtils;Expand description
Version comparison and manipulation utilities
Implementations§
Source§impl VersionUtils
impl VersionUtils
Sourcepub fn sort_versions_desc(versions: Vec<VersionInfo>) -> Vec<VersionInfo>
pub fn sort_versions_desc(versions: Vec<VersionInfo>) -> Vec<VersionInfo>
Sort versions in descending order (latest first)
Sourcepub fn filter_stable_only(versions: Vec<VersionInfo>) -> Vec<VersionInfo>
pub fn filter_stable_only(versions: Vec<VersionInfo>) -> Vec<VersionInfo>
Filter out prerelease versions
Sourcepub fn take_latest(versions: Vec<VersionInfo>, count: usize) -> Vec<VersionInfo>
pub fn take_latest(versions: Vec<VersionInfo>, count: usize) -> Vec<VersionInfo>
Get the latest N versions
Sourcepub fn filter_lts_only(versions: Vec<VersionInfo>) -> Vec<VersionInfo>
pub fn filter_lts_only(versions: Vec<VersionInfo>) -> Vec<VersionInfo>
Filter versions by LTS status
Sourcepub fn find_version<'a>(
versions: &'a [VersionInfo],
version: &str,
) -> Option<&'a VersionInfo>
pub fn find_version<'a>( versions: &'a [VersionInfo], version: &str, ) -> Option<&'a VersionInfo>
Find a specific version in a list
Sourcepub fn matches_pattern(version: &str, pattern: &str) -> bool
pub fn matches_pattern(version: &str, pattern: &str) -> bool
Check if a version string matches a pattern
Sourcepub fn is_prerelease(version: &str) -> bool
pub fn is_prerelease(version: &str) -> bool
Check if a version string indicates a prerelease
Sourcepub fn clean_version(version: &str, prefixes: &[&str]) -> String
pub fn clean_version(version: &str, prefixes: &[&str]) -> String
Clean version string (remove prefixes like ‘v’, ‘go’, etc.)
Sourcepub fn compare_versions(a: &str, b: &str) -> Ordering
pub fn compare_versions(a: &str, b: &str) -> Ordering
Compare two version strings
Sourcepub fn is_greater_than(a: &str, b: &str) -> bool
pub fn is_greater_than(a: &str, b: &str) -> bool
Check if version A is greater than version B
Sourcepub fn is_less_than(a: &str, b: &str) -> bool
pub fn is_less_than(a: &str, b: &str) -> bool
Check if version A is less than version B
Auto Trait Implementations§
impl Freeze for VersionUtils
impl RefUnwindSafe for VersionUtils
impl Send for VersionUtils
impl Sync for VersionUtils
impl Unpin for VersionUtils
impl UnsafeUnpin for VersionUtils
impl UnwindSafe for VersionUtils
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