Skip to main content

compare_version/
struct.rs

1/// Represents a semantic version with major, minor, patch, and pre-release components.
2///
3/// Follows semantic versioning specification (SemVer).
4#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
5pub(crate) struct Version {
6    /// Major version number.
7    pub(crate) major: u32,
8    /// Minor version number.
9    pub(crate) minor: u32,
10    /// Patch version number.
11    pub(crate) patch: u32,
12    /// Optional pre-release identifier.
13    pub(crate) pre_release: Option<String>,
14}
15
16/// Utility for comparing version strings.
17///
18/// Provides methods for version comparison and range matching.
19#[derive(Clone, Copy, Debug, Default)]
20pub struct CompareVersion;