ascom_alpaca/api/
server_info.rs1use serde::{Deserialize, Serialize};
2use std::borrow::Cow;
3
4#[derive(Debug, Serialize, Deserialize)]
5pub(crate) struct ConfiguredDevice<DeviceType> {
6 #[serde(rename = "DeviceName")]
7 pub(crate) name: String,
8 #[serde(rename = "DeviceType")]
9 pub(crate) ty: DeviceType,
10 #[serde(rename = "DeviceNumber")]
11 pub(crate) number: usize,
12 #[serde(rename = "UniqueID")]
13 pub(crate) unique_id: String,
14}
15
16#[derive(Debug, Serialize, Deserialize, derive_more::Display)]
18#[display("{server_name} v{manufacturer_version} by {manufacturer}")]
19#[serde(rename_all = "PascalCase")]
20pub struct ServerInfo {
21 pub server_name: Cow<'static, str>,
23 pub manufacturer: Cow<'static, str>,
25 pub manufacturer_version: Cow<'static, str>,
27 pub location: Cow<'static, str>,
29}
30
31#[doc(hidden)]
33#[macro_export]
34macro_rules! CargoServerInfo_1bc8c806_8cb9_4aaf_b57a_8f94c4d1b59d {
35 () => {
36 const {
37 use std::borrow::Cow;
38
39 $crate::api::ServerInfo {
40 server_name: Cow::Borrowed(env!("CARGO_PKG_NAME")),
41 manufacturer: Cow::Borrowed(env!("CARGO_PKG_AUTHORS")),
42 manufacturer_version: Cow::Borrowed(env!("CARGO_PKG_VERSION")),
43 location: {
44 let homepage = env!("CARGO_PKG_HOMEPAGE");
47 Cow::Borrowed(if homepage.is_empty() {
48 "Unknown"
49 } else {
50 homepage
51 })
52 },
53 }
54 }
55 };
56}
57
58#[doc(inline)]
60pub use CargoServerInfo_1bc8c806_8cb9_4aaf_b57a_8f94c4d1b59d as CargoServerInfo;