pub struct TempProjectBuilder { /* private fields */ }Expand description
Builder for TempProject.
§Example
use dev_fixtures::TempProject;
let _ = TempProject::new()
.with_file("a.txt", "hello")
.with_bytes("b.bin", vec![1, 2, 3])
.build()
.unwrap();Implementations§
Source§impl TempProjectBuilder
impl TempProjectBuilder
Sourcepub fn with_file(
self,
relative_path: impl Into<PathBuf>,
contents: impl Into<String>,
) -> Self
pub fn with_file( self, relative_path: impl Into<PathBuf>, contents: impl Into<String>, ) -> Self
Stage a UTF-8 text file at relative_path inside the temp project.
Sourcepub fn with_bytes(
self,
relative_path: impl Into<PathBuf>,
contents: impl Into<Vec<u8>>,
) -> Self
pub fn with_bytes( self, relative_path: impl Into<PathBuf>, contents: impl Into<Vec<u8>>, ) -> Self
Stage a binary file at relative_path inside the temp project.
Sourcepub fn build(self) -> Result<TempProject>
pub fn build(self) -> Result<TempProject>
Build the temp project on disk.
Trait Implementations§
Source§impl Default for TempProjectBuilder
impl Default for TempProjectBuilder
Source§fn default() -> TempProjectBuilder
fn default() -> TempProjectBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TempProjectBuilder
impl RefUnwindSafe for TempProjectBuilder
impl Send for TempProjectBuilder
impl Sync for TempProjectBuilder
impl Unpin for TempProjectBuilder
impl UnsafeUnpin for TempProjectBuilder
impl UnwindSafe for TempProjectBuilder
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