parallel_disk_usage/reporter/
event.rs

1use super::ErrorReport;
2use crate::size;
3use std::{fs::Metadata, path::Path};
4
5/// Report trigger event.
6#[derive(Debug)]
7#[non_exhaustive]
8pub enum Event<'a, Size: size::Size> {
9    ReceiveData(Size),
10    EncounterError(ErrorReport<'a>),
11    DetectHardlink(HardlinkDetection<'a, Size>),
12}
13
14/// Data of [`Event::DetectHardlink`].
15#[derive(Debug, Clone, Copy)]
16pub struct HardlinkDetection<'a, Size: size::Size> {
17    /// Path of the detected hardlink.
18    pub path: &'a Path,
19    /// Stats of the detected hardlink.
20    pub stats: &'a Metadata,
21    /// Size of the file.
22    pub size: Size,
23    /// Number of links, including this one.
24    pub links: u64,
25}