parallel_disk_usage/hardlink/
record.rs1use std::{fs::Metadata, path::Path};
2
3#[derive(Debug, Clone, Copy)]
5pub struct Argument<'a, Size, Report: ?Sized> {
6 pub path: &'a Path,
7 pub stats: &'a Metadata,
8 pub size: Size,
9 pub reporter: &'a Report,
10}
11
12pub use Argument as RecordHardlinksArgument;
13
14impl<'a, Size, Report: ?Sized> Argument<'a, Size, Report> {
15 #[inline]
16 pub(crate) fn new(
17 path: &'a Path,
18 stats: &'a Metadata,
19 size: Size,
20 reporter: &'a Report,
21 ) -> Self {
22 Argument {
23 path,
24 stats,
25 size,
26 reporter,
27 }
28 }
29}
30
31pub trait RecordHardlinks<Size, Reporter: ?Sized> {
33 type Error;
35 fn record_hardlinks(&self, argument: Argument<Size, Reporter>) -> Result<(), Self::Error>;
37}
38
39#[cfg(unix)]
41pub type Do<Size> = super::HardlinkAware<Size>;
42pub type DoNot = super::HardlinkIgnorant;