Common/FileSystem/DTO/FileTypeDTO.rs
1//! # FileTypeDTO
2//!
3//! Defines the Data Transfer Object enum for representing the type of a
4//! filesystem entry.
5
6use serde::{Deserialize, Serialize};
7
8/// Represents the type of a filesystem entry.
9///
10/// This is a C-like enum with an explicit `u8` representation. The values are
11/// chosen to align directly with VS Code's internal `FileType` enum, ensuring
12/// seamless interoperability across the IPC boundary. It is used as a bitmask
13/// to allow for combinations (e.g., a symbolic link to a directory).
14#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)]
15#[repr(u8)]
16pub enum FileTypeDTO {
17 /// The file type is unknown.
18 Unknown = 0,
19
20 /// A regular file.
21 File = 1,
22
23 /// A directory.
24 Directory = 2,
25
26 /// A symbolic link.
27 SymbolicLink = 64,
28}