use std::{fs::Metadata, path::Path};
#[derive(Debug, Clone, Copy)]
pub struct Argument<'a, Size, Report: ?Sized> {
pub path: &'a Path,
pub stats: &'a Metadata,
pub size: Size,
pub reporter: &'a Report,
}
pub use Argument as RecordHardlinksArgument;
impl<'a, Size, Report: ?Sized> Argument<'a, Size, Report> {
#[inline]
pub(crate) fn new(
path: &'a Path,
stats: &'a Metadata,
size: Size,
reporter: &'a Report,
) -> Self {
Argument {
path,
stats,
size,
reporter,
}
}
}
pub trait RecordHardlinks<Size, Reporter: ?Sized> {
type Error;
fn record_hardlinks(&self, argument: Argument<Size, Reporter>) -> Result<(), Self::Error>;
}
#[cfg(unix)]
pub type Do<Size> = super::HardlinkAware<Size>;
pub type DoNot = super::HardlinkIgnorant;