plane_common/
version.rs

1use serde::{Deserialize, Serialize};
2
3/// The version of the plane binary from Cargo.toml.
4pub const PLANE_VERSION: &str = env!("CARGO_PKG_VERSION");
5
6/// The git hash of the plane binary (passed from build.rs)
7pub const PLANE_GIT_HASH: &str = env!("GIT_HASH");
8
9#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
10pub struct PlaneVersionInfo {
11    pub version: String,
12    pub git_hash: String,
13}
14
15pub fn plane_version_info() -> PlaneVersionInfo {
16    PlaneVersionInfo {
17        version: PLANE_VERSION.to_string(),
18        git_hash: PLANE_GIT_HASH.to_string(),
19    }
20}
21
22pub const SERVER_NAME: &str = concat!("Plane/", env!("CARGO_PKG_VERSION"), "-", env!("GIT_HASH"));