keramics_vfs/
enums.rs

1/* Copyright 2024-2025 Joachim Metz <joachim.metz@gmail.com>
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may
5 * obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 * License for the specific language governing permissions and limitations
11 * under the License.
12 */
13
14#[derive(Clone, PartialEq)]
15pub enum VfsFileType {
16    BlockDevice,
17    CharacterDevice,
18    Device,
19    Directory,
20    File,
21    NamedPipe,
22    Socket,
23    SymbolicLink,
24    Unknown(u16),
25    Whiteout,
26}
27
28#[derive(Clone, Eq, Hash, PartialEq)]
29pub enum VfsType {
30    Apm,
31    Ext,
32    Ewf,
33    Fake,
34    Gpt,
35    Mbr,
36    Ntfs,
37    Os,
38    Qcow,
39    SparseImage,
40    Udif,
41    Vhd,
42    Vhdx,
43}
44
45impl VfsType {
46    /// Retrieves a string representation of the type.
47    pub fn as_str(&self) -> &str {
48        match self {
49            VfsType::Apm => "APM",
50            VfsType::Ext => "EXT",
51            VfsType::Ewf => "EWF",
52            VfsType::Fake => "FAKE",
53            VfsType::Gpt => "GPT",
54            VfsType::Mbr => "MBR",
55            VfsType::Ntfs => "NTFS",
56            VfsType::Os => "OS",
57            VfsType::Qcow => "QCOW",
58            VfsType::SparseImage => "SPARSEIMAGE",
59            VfsType::Udif => "UDIF",
60            VfsType::Vhd => "VHD",
61            VfsType::Vhdx => "VHDX",
62        }
63    }
64}