Version

Trait Version 

Source
pub trait Version: Send + Sync {
    // Required methods
    fn version_string(&self) -> &str;
    fn is_yanked(&self) -> bool;
    fn as_any(&self) -> &dyn Any;

    // Provided methods
    fn is_prerelease(&self) -> bool { ... }
    fn features(&self) -> Vec<String> { ... }
    fn is_stable(&self) -> bool { ... }
}
Expand description

Version information trait.

All version types must implement this to work with generic handlers.

Required Methods§

Source

fn version_string(&self) -> &str

Version string (e.g., “1.0.214”, “14.21.3”).

Source

fn is_yanked(&self) -> bool

Whether this version is yanked/deprecated.

Source

fn as_any(&self) -> &dyn Any

Downcast to concrete version type

Provided Methods§

Source

fn is_prerelease(&self) -> bool

Whether this version is a pre-release (alpha, beta, rc, etc.).

Default implementation checks for common pre-release patterns.

Source

fn features(&self) -> Vec<String>

Available feature flags (empty if not supported by ecosystem).

Source

fn is_stable(&self) -> bool

Whether this version is stable (not yanked and not pre-release).

Implementors§