Struct conserve::test_fixtures::TreeFixture
source · pub struct TreeFixture {
pub root: PathBuf,
/* private fields */
}
Expand description
A temporary tree for running a test.
Created in a temporary directory and automatically disposed when done.
Fields§
§root: PathBuf
Implementations§
source§impl TreeFixture
impl TreeFixture
pub fn new() -> TreeFixture
pub fn path(&self) -> &Path
sourcepub fn create_file(&self, relative_path: &str) -> PathBuf
pub fn create_file(&self, relative_path: &str) -> PathBuf
Make a file in the tree, with arbitrary contents. Returns the full path.
sourcepub fn create_file_with_contents(
&self,
relative_path: &str,
contents: &[u8]
) -> PathBuf
pub fn create_file_with_contents( &self, relative_path: &str, contents: &[u8] ) -> PathBuf
Make a file in the tree, with given contents. Returns the full path.
sourcepub fn create_file_of_length_with_prefix(
&self,
relative_path: &str,
length: u64,
prefix: &[u8]
) -> PathBuf
pub fn create_file_of_length_with_prefix( &self, relative_path: &str, length: u64, prefix: &[u8] ) -> PathBuf
Create a file with a specified length. The first bytes of the file are the prefix
and the remainder is zeros.
sourcepub fn create_dir(&self, relative_path: &str) -> PathBuf
pub fn create_dir(&self, relative_path: &str) -> PathBuf
Create a new subdirectory and return its full path.
pub fn create_symlink(&self, relative_path: &str, target: &str)
pub fn live_tree(&self) -> LiveTree
pub fn make_file_unreadable(&self, relative_path: &str)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for TreeFixture
impl Send for TreeFixture
impl Sync for TreeFixture
impl Unpin for TreeFixture
impl UnwindSafe for TreeFixture
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