Struct cli_sandbox::Project
source · pub struct Project { /* private fields */ }Implementations§
source§impl Project
impl Project
sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Gets the std::path::Path for the Project’s temporary directory.
sourcepub fn new_file<P: AsRef<Path>>(
&mut self,
path: P,
contents: &str
) -> Result<()>
pub fn new_file<P: AsRef<Path>>( &mut self, path: P, contents: &str ) -> Result<()>
Creates a new file with a relative path to the project’s directory.
path gets redirected to the project’s real path (temporary and unknown).
sourcepub fn check_file<P: AsRef<Path>>(&self, path: P, contents: &str) -> Result<()>
pub fn check_file<P: AsRef<Path>>(&self, path: P, contents: &str) -> Result<()>
Checks that the contents of a file are correct. It will panic if they aren’t, and show the differences if the feature pretty_assertions is enabled
path gets redirected to the project’s real path (temporary and unknown)
Panics
Will panic if the contents of the file at path aren’t encoded as UTF-8
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
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