pub struct ProjectBuilder { /* private fields */ }
Expand description
An RAII guard that controls a temporary directory of test files.
It is also a builder and is used to build up the temporary files, which are then deleted on drop.
Implementations§
Source§impl ProjectBuilder
impl ProjectBuilder
Sourcepub fn new(name: &str) -> ProjectBuilder
pub fn new(name: &str) -> ProjectBuilder
Create a ProjectBuilder that will manage a new temporary directory making use of the current name.
Sourcepub fn file<P, B>(self, path: P, body: B) -> ProjectBuilder
pub fn file<P, B>(self, path: P, body: B) -> ProjectBuilder
Add a new file to the temporary directory with the given contents.
Sourcepub fn build(&self) -> &ProjectBuilder
pub fn build(&self) -> &ProjectBuilder
Creates the project layout, based on current state of the builder
Sourcepub fn build_with_result(&self) -> Result<(), String>
pub fn build_with_result(&self) -> Result<(), String>
Creates the project layout, based on current state of the builder
Trait Implementations§
Source§impl Clone for ProjectBuilder
impl Clone for ProjectBuilder
Source§fn clone(&self) -> ProjectBuilder
fn clone(&self) -> ProjectBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ProjectBuilder
impl Debug for ProjectBuilder
Source§impl Drop for ProjectBuilder
impl Drop for ProjectBuilder
Source§impl PartialEq for ProjectBuilder
impl PartialEq for ProjectBuilder
Auto Trait Implementations§
impl Freeze for ProjectBuilder
impl RefUnwindSafe for ProjectBuilder
impl Send for ProjectBuilder
impl Sync for ProjectBuilder
impl Unpin for ProjectBuilder
impl UnwindSafe for ProjectBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)