nullnet_libconfmon/watcher/types.rs
1use std::path::PathBuf;
2
3/// Represents the data of a file, including its name and content.
4///
5/// # Fields
6/// - `filename`: The name of the file.
7/// - `content`: The binary content of the file, stored as a vector of bytes.
8#[derive(Debug)]
9pub struct FileData {
10 pub filename: String,
11 pub content: Vec<u8>,
12}
13
14/// Contains metadata about a file, including its path and modification time.
15///
16/// # Fields
17/// - `path`: The filesystem path to the file.
18/// - `mtime`: The modification time of the file, represented as the number of milliseconds
19/// since the UNIX epoch.
20#[derive(Debug)]
21pub struct FileInfo {
22 pub path: PathBuf,
23 pub mtime: u128,
24}
25
26/// A snapshot representing a collection of file data.
27///
28/// This is used to store the current state of multiple files, where each file
29/// is represented by its `FileData`.
30pub type Snapshot = Vec<FileData>;