pve/nodes/node/lxc/vmid/status/
suspend.rs

1#[derive(Debug, Clone)]
2pub struct SuspendClient<T> {
3    client: T,
4    path: String,
5}
6
7impl<T> SuspendClient<T>
8where
9    T: Clone,
10{
11    pub fn new(client: T, parent_path: &str) -> Self {
12        Self {
13            client,
14            path: format!("{}/{}", parent_path, "suspend"),
15        }
16    }
17}
18impl<T> SuspendClient<T>
19where
20    T: crate::client::HttpClient,
21{
22    #[doc = "Suspend the container. This is experimental."]
23    pub fn post(&self) -> Result<String, T::Error> {
24        self.client.post(&self.path, &())
25    }
26}
27#[derive(Debug, Clone)]
28pub struct AsyncSuspendClient<T> {
29    client: T,
30    path: String,
31}
32
33impl<T> AsyncSuspendClient<T>
34where
35    T: Clone,
36{
37    pub fn new(client: T, parent_path: &str) -> Self {
38        Self {
39            client,
40            path: format!("{}/{}", parent_path, "suspend"),
41        }
42    }
43}
44impl<T> AsyncSuspendClient<T>
45where
46    T: crate::client::AsyncHttpClient,
47{
48    #[doc = "Suspend the container. This is experimental."]
49    pub async fn post(&self) -> Result<String, T::Error> {
50        self.client.post(&self.path, &()).await
51    }
52}