proxmox_api/generated/nodes/node/hardware/pci/pciid/
mdev.rs

1pub struct MdevClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> MdevClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/mdev"),
13        }
14    }
15}
16impl<T> MdevClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "List mediated device types for given PCI device."]
21    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &())
24    }
25}
26impl GetOutputItems {
27    pub fn new(available: u64, description: String, ty: String) -> Self {
28        Self {
29            available,
30            description,
31            ty,
32            additional_properties: Default::default(),
33        }
34    }
35}
36#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
37pub struct GetOutputItems {
38    #[serde(
39        serialize_with = "crate::types::serialize_int",
40        deserialize_with = "crate::types::deserialize_int"
41    )]
42    #[doc = "The number of still available instances of this type."]
43    pub available: u64,
44    pub description: String,
45    #[serde(rename = "type")]
46    #[doc = "The name of the mdev type."]
47    pub ty: String,
48    #[serde(
49        flatten,
50        default,
51        skip_serializing_if = "::std::collections::HashMap::is_empty"
52    )]
53    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
54}