pve/nodes/node/
capabilities.rs1pub mod qemu;
2
3#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
4pub struct GetResponseItem {}
5
6#[derive(Debug, Clone)]
7pub struct CapabilitiesClient<T> {
8    client: T,
9    path: String,
10}
11
12impl<T> CapabilitiesClient<T>
13where
14    T: Clone,
15{
16    pub fn new(client: T, parent_path: &str) -> Self {
17        Self {
18            client,
19            path: format!("{}/{}", parent_path, "capabilities"),
20        }
21    }
22
23    pub fn qemu(&self) -> qemu::QemuClient<T> {
24        qemu::QemuClient::<T>::new(self.client.clone(), &self.path)
25    }
26}
27impl<T> CapabilitiesClient<T>
28where
29    T: crate::client::HttpClient,
30{
31    #[doc = "Node capabilities index."]
32    pub fn get(&self) -> Result<Vec<GetResponseItem>, T::Error> {
33        self.client.get(&self.path, &())
34    }
35}
36#[derive(Debug, Clone)]
37pub struct AsyncCapabilitiesClient<T> {
38    client: T,
39    path: String,
40}
41
42impl<T> AsyncCapabilitiesClient<T>
43where
44    T: Clone,
45{
46    pub fn new(client: T, parent_path: &str) -> Self {
47        Self {
48            client,
49            path: format!("{}/{}", parent_path, "capabilities"),
50        }
51    }
52
53    pub fn qemu(&self) -> qemu::AsyncQemuClient<T> {
54        qemu::AsyncQemuClient::<T>::new(self.client.clone(), &self.path)
55    }
56}
57impl<T> AsyncCapabilitiesClient<T>
58where
59    T: crate::client::AsyncHttpClient,
60{
61    #[doc = "Node capabilities index."]
62    pub async fn get(&self) -> Result<Vec<GetResponseItem>, T::Error> {
63        self.client.get(&self.path, &()).await
64    }
65}