Skip to main content

nil_payload/response/
server.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use derive_more::{Deref, DerefMut, Display, From, Into};
5use nil_server_types::ServerKind;
6use semver::Version;
7use serde::{Deserialize, Serialize};
8
9#[cfg(feature = "axum")]
10use nil_payload_macros::IntoJsonResponse;
11
12#[derive(Clone, Copy, Debug, Deref, DerefMut, Display, From, Into, Deserialize, Serialize)]
13#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
14#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
15#[cfg_attr(feature = "typescript", ts(export))]
16pub struct GetServerKindResponse(pub ServerKind);
17
18#[derive(Clone, Debug, Deref, DerefMut, Display, From, Into, Deserialize, Serialize)]
19#[cfg_attr(feature = "axum", derive(IntoJsonResponse))]
20#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
21#[cfg_attr(feature = "typescript", ts(export))]
22pub struct VersionResponse(pub Version);