pub struct TempProject { /* private fields */ }Expand description
A temporary project directory that auto-cleans on drop.
Holds an internal tempfile::TempDir. The temp directory is deleted
when this value is dropped.
§Example
use dev_fixtures::TempProject;
let p = TempProject::new()
.with_file("README.md", "hello")
.build()
.unwrap();
assert!(p.path().join("README.md").exists());Implementations§
Source§impl TempProject
impl TempProject
Sourcepub fn new() -> TempProjectBuilder
pub fn new() -> TempProjectBuilder
Begin building a temp project.
Returns a TempProjectBuilder (not Self); call .build()
on it to materialize the directory.
Sourcepub fn declared_files(&self) -> impl Iterator<Item = (&Path, &[u8])>
pub fn declared_files(&self) -> impl Iterator<Item = (&Path, &[u8])>
Files declared at build time. Useful for diagnostics.
Auto Trait Implementations§
impl Freeze for TempProject
impl RefUnwindSafe for TempProject
impl Send for TempProject
impl Sync for TempProject
impl Unpin for TempProject
impl UnsafeUnpin for TempProject
impl UnwindSafe for TempProject
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