parallel_disk_usage/json_data/
binary_version.rs

1use derive_more::{AsMut, AsRef, From, FromStr, Into};
2
3#[cfg(feature = "json")]
4use serde::{Deserialize, Serialize};
5
6/// Version of the current `pdu` program.
7pub const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION");
8
9/// Version of the `pdu` program that created the input JSON.
10#[derive(Debug, Clone, PartialEq, Eq, AsMut, AsRef, From, FromStr, Into)]
11#[cfg_attr(feature = "json", derive(Deserialize, Serialize))]
12pub struct BinaryVersion(String);
13
14impl BinaryVersion {
15    /// Get version of the current `pdu` program as a `BinaryVersion`.
16    pub fn current() -> Self {
17        CURRENT_VERSION.to_string().into()
18    }
19}