Expand description
§vx-version
Version management and parsing utilities for the vx universal tool manager.
This crate provides comprehensive version management capabilities including:
- Semantic version parsing and comparison
- Version fetching from various sources (GitHub, npm, PyPI, etc.)
- Version constraint resolution
- Tool-specific version parsing
§Features
- Version Parsing: Parse and compare semantic versions
- Version Fetching: Fetch available versions from external sources
- Version Constraints: Support for version ranges and constraints
- Tool Integration: Specialized parsers for different tools
- Async Support: Async-first design for network operations
§Example
use vx_version::{VersionInfo, VersionFetcher, GitHubVersionFetcher};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Create a version fetcher for a GitHub repository
let fetcher = GitHubVersionFetcher::new("astral-sh", "uv");
// Fetch available versions
let versions = fetcher.fetch_versions(false).await?;
// Get the latest version
if let Some(latest) = versions.first() {
println!("Latest version: {}", latest.version);
}
Ok(())
}
Re-exports§
pub use error::Result;
pub use error::VersionError;
pub use fetcher::GitHubVersionFetcher;
pub use fetcher::NodeVersionFetcher;
pub use fetcher::VersionFetcher;
pub use manager::VersionManager;
pub use parser::GitHubVersionParser;
pub use parser::GoVersionParser;
pub use parser::NodeVersionParser;
pub use parser::VersionParser;
pub use utils::VersionUtils;
Modules§
- error
- Error types for version management operations
- fetcher
- Version fetching traits and implementations
- manager
- Version management utilities
- parser
- Version parsing utilities for different tools
- utils
- Version utility functions
Structs§
- Version
Info - Information about a tool version
Constants§
- VERSION
- Version of this crate