winget_types/installer/
installer_type.rs

1use serde::{Deserialize, Serialize};
2
3use crate::installer::nested::installer_type::NestedInstallerType;
4
5/// Enumeration of supported installer shared. `InstallerType` is required in either root level or
6/// individual Installer level
7#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
8#[serde(rename_all = "lowercase")]
9pub enum InstallerType {
10    Msix,
11    Msi,
12    Appx,
13    Exe,
14    Zip,
15    Inno,
16    Nullsoft,
17    Wix,
18    Burn,
19    Pwa,
20    Portable,
21}
22
23impl InstallerType {
24    #[must_use]
25    pub const fn to_nested(self) -> Option<NestedInstallerType> {
26        match self {
27            Self::Msix => Some(NestedInstallerType::Msix),
28            Self::Msi => Some(NestedInstallerType::Msi),
29            Self::Appx => Some(NestedInstallerType::Appx),
30            Self::Exe => Some(NestedInstallerType::Exe),
31            Self::Inno => Some(NestedInstallerType::Inno),
32            Self::Nullsoft => Some(NestedInstallerType::Nullsoft),
33            Self::Wix => Some(NestedInstallerType::Wix),
34            Self::Burn => Some(NestedInstallerType::Burn),
35            Self::Portable => Some(NestedInstallerType::Portable),
36            _ => None,
37        }
38    }
39}