pub struct MetadataHandler;Expand description
A utility for scrubbing and randomizing file metadata.
This component focuses on the anti-forensic aspects of shredding that go beyond raw data destruction.
Implementations§
Source§impl MetadataHandler
impl MetadataHandler
Sourcepub fn obfuscate_filename(path: &Path) -> ShredResult<PathBuf>
pub fn obfuscate_filename(path: &Path) -> ShredResult<PathBuf>
Renames a file to a randomly generated alphanumeric string.
Sourcepub fn truncate(path: &Path) -> ShredResult<()>
pub fn truncate(path: &Path) -> ShredResult<()>
Truncates a file to zero bytes and flushes the change.
Sourcepub fn trim(path: &Path) -> ShredResult<()>
pub fn trim(path: &Path) -> ShredResult<()>
Informs the OS/Hardware to discard the file’s blocks (TRIM).
On Linux, this uses fallocate with FALLOC_FL_PUNCH_HOLE.
On Windows, it uses FSCTL_SET_ZERO_DATA.
Auto Trait Implementations§
impl Freeze for MetadataHandler
impl RefUnwindSafe for MetadataHandler
impl Send for MetadataHandler
impl Sync for MetadataHandler
impl Unpin for MetadataHandler
impl UnsafeUnpin for MetadataHandler
impl UnwindSafe for MetadataHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more