1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use crate::wire::wire_enum;
wire_enum! {
/// The host-system interpretation of a ZIP member's external attributes.
///
/// This is the high byte of "version made by" (APPNOTE section 4.4.2).
/// It identifies attribute compatibility, not necessarily the writer's OS.
/// Conversions to and from [`u8`] preserve unrecognized identifiers.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum HostSystem(u8) {
/// MS-DOS and OS/2 FAT, VFAT, and FAT32 filesystems.
MsDos = 0,
/// Amiga.
Amiga = 1,
/// OpenVMS.
OpenVms = 2,
/// UNIX.
Unix = 3,
/// VM/CMS.
VmCms = 4,
/// Atari ST.
AtariSt = 5,
/// OS/2 HPFS.
Os2Hpfs = 6,
/// Macintosh.
Macintosh = 7,
/// Z-System.
ZSystem = 8,
/// CP/M.
Cpm = 9,
/// Windows NTFS.
WindowsNtfs = 10,
/// MVS, OS/390, and z/OS.
Mvs = 11,
/// VSE.
Vse = 12,
/// Acorn RISC.
AcornRisc = 13,
/// VFAT.
Vfat = 14,
/// Alternate MVS.
AlternateMvs = 15,
/// BeOS.
BeOs = 16,
/// Tandem.
Tandem = 17,
/// OS/400.
Os400 = 18,
/// OS X (Darwin).
Darwin = 19,
}
}
#[cfg(test)]
mod tests {
use super::HostSystem;
#[test]
fn preserves_host_identifiers() {
for value in u8::MIN..=u8::MAX {
let host = HostSystem::from(value);
if value >= 20 {
assert_eq!(host, HostSystem::Unknown(value));
}
assert_eq!(u8::from(host), value);
}
}
}