Common/FileSystem/DTO/FileSystemStatDTO.rs
1//! # FileSystemStatDTO
2//!
3//! Defines the Data Transfer Object for file and directory metadata.
4
5use serde::{Deserialize, Serialize};
6
7/// A serializable struct that represents metadata for a filesystem entry.
8///
9/// This DTO is returned by the `StatFile` effect and is analogous to VS Code's
10/// `FileStat` interface, providing essential information like file type, size,
11
12/// and modification times.
13#[derive(Serialize, Deserialize, Debug, Clone)]
14#[serde(rename_all = "PascalCase")]
15pub struct FileSystemStatDTO {
16 /// A bitmask representing the type of the file.
17 /// @see FileTypeDTO
18 pub FileType:u8,
19
20 /// The creation time of the file in milliseconds since the UNIX epoch.
21 pub CreationTime:u64,
22
23 /// The last modification time of the file in milliseconds since the UNIX
24 /// epoch.
25 pub ModificationTime:u64,
26
27 /// The size of the file in bytes.
28 pub Size:u64,
29
30 /// An optional bitmask representing the file's permissions. This is
31 /// platform-specific and may not always be available.
32 #[serde(skip_serializing_if = "Option::is_none")]
33 pub Permissions:Option<u32>,
34}