impl_version

Macro impl_version 

Source
macro_rules! impl_version {
    ($type:ty {
        version: $version:ident,
        yanked: $yanked:ident $(,)?
    }) => { ... };
}
Expand description

Implement Version and VersionInfo traits for a struct.

§Arguments

  • $type - The struct type name
  • version - Field name for version string (String)
  • yanked - Field name for yanked/deprecated status (bool)

§Examples

use deps_core::impl_version;

pub struct MyVersion {
    pub version: String,
    pub deprecated: bool,
}

impl_version!(MyVersion {
    version: version,
    yanked: deprecated,
});