winbrew_core\fs\archive/kind.rs
1/// Archive formats supported by WinBrew's extraction layer.
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum ArchiveKind {
4 /// ZIP archive format.
5 Zip,
6 /// 7-Zip archive format.
7 SevenZip,
8 /// GZip single-file compression format.
9 Gzip,
10 /// Tar-based archive family, including `.tar`, `.tar.gz`, `.tgz`, `.tbz2`, and `.tar.bz2`.
11 Tar,
12 /// RAR archive format.
13 Rar,
14}
15
16impl ArchiveKind {
17 /// Return the canonical lowercase name used in errors and logs.
18 pub fn as_str(self) -> &'static str {
19 match self {
20 Self::Zip => "zip",
21 Self::SevenZip => "7z",
22 Self::Gzip => "gzip",
23 Self::Tar => "tar",
24 Self::Rar => "rar",
25 }
26 }
27}