pub struct TarTestBuilder { /* private fields */ }Expand description
Builder for creating TAR test archives with various entry types.
Supports files, directories, symlinks, and hardlinks.
§Examples
use exarch_core::test_utils::TarTestBuilder;
let tar_data = TarTestBuilder::new()
.add_file("file.txt", b"content")
.add_directory("dir/")
.add_symlink("link", "file.txt")
.build();Implementations§
Source§impl TarTestBuilder
impl TarTestBuilder
Sourcepub fn add_file_with_mode(self, path: &str, data: &[u8], mode: u32) -> Self
pub fn add_file_with_mode(self, path: &str, data: &[u8], mode: u32) -> Self
Adds a regular file with custom mode.
Sourcepub fn add_directory(self, path: &str) -> Self
pub fn add_directory(self, path: &str) -> Self
Adds a directory to the archive.
Sourcepub fn add_symlink(self, path: &str, target: &str) -> Self
pub fn add_symlink(self, path: &str, target: &str) -> Self
Adds a symlink to the archive.
Sourcepub fn add_hardlink(self, path: &str, target: &str) -> Self
pub fn add_hardlink(self, path: &str, target: &str) -> Self
Adds a hardlink to the archive.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TarTestBuilder
impl RefUnwindSafe for TarTestBuilder
impl Send for TarTestBuilder
impl Sync for TarTestBuilder
impl Unpin for TarTestBuilder
impl UnwindSafe for TarTestBuilder
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