objectiveai_sdk/filesystem/plugins/
platform.rs1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
13#[schemars(rename = "filesystem.plugins.Platform")]
14pub enum Platform {
15 #[serde(rename = "linux_x86_64")]
16 LinuxX86_64,
17 #[serde(rename = "linux_aarch64")]
18 LinuxAarch64,
19 #[serde(rename = "windows_x86_64")]
20 WindowsX86_64,
21 #[serde(rename = "windows_aarch64")]
22 WindowsAarch64,
23 #[serde(rename = "macos_x86_64")]
24 MacosX86_64,
25 #[serde(rename = "macos_aarch64")]
26 MacosAarch64,
27}
28
29impl Platform {
30 pub fn current() -> Option<Self> {
34 match (std::env::consts::OS, std::env::consts::ARCH) {
35 ("linux", "x86_64") => Some(Self::LinuxX86_64),
36 ("linux", "aarch64") => Some(Self::LinuxAarch64),
37 ("windows", "x86_64") => Some(Self::WindowsX86_64),
38 ("windows", "aarch64") => Some(Self::WindowsAarch64),
39 ("macos", "x86_64") => Some(Self::MacosX86_64),
40 ("macos", "aarch64") => Some(Self::MacosAarch64),
41 _ => None,
42 }
43 }
44}