pub trait FileWriteStr {
// Required method
fn write_str(&self, data: &str) -> Result<(), FixtureError>;
}Expand description
Write a text file at a ChildPath or NamedUtf8TempFile.
Required Methods§
Sourcefn write_str(&self, data: &str) -> Result<(), FixtureError>
fn write_str(&self, data: &str) -> Result<(), FixtureError>
Write a text file at ChildPath or NamedUtf8TempFile.
§Examples
use camino_tempfile_ext::prelude::*;
let temp = Utf8TempDir::new().unwrap();
temp.child("foo.txt")
.write_str("To be or not to be...")
.unwrap();
temp.close().unwrap();