pub struct PetriLogSource(/* private fields */);Expand description
A source of PetriLogFile log files for test output.
Implementations§
Source§impl PetriLogSource
impl PetriLogSource
Sourcepub fn log_file(&self, name: &str) -> Result<PetriLogFile>
pub fn log_file(&self, name: &str) -> Result<PetriLogFile>
Returns a log file for the given name.
The name should not have an extension; .log will be appended
automatically.
Sourcepub fn create_attachment(&self, filename: &str) -> Result<File>
pub fn create_attachment(&self, filename: &str) -> Result<File>
Creates a file with the given name and returns a handle to it.
If the file already exists, a unique name is generated by appending a number to the base name.
Sourcepub fn write_attachment(
&self,
filename: &str,
data: impl Read,
) -> Result<PathBuf>
pub fn write_attachment( &self, filename: &str, data: impl Read, ) -> Result<PathBuf>
Writes the given data to a file with the given name.
If the file already exists, a unique name is generated by appending a number to the base name.
Sourcepub fn copy_attachment(
&self,
attachment_filename: &str,
source_path: &Path,
) -> Result<()>
pub fn copy_attachment( &self, attachment_filename: &str, source_path: &Path, ) -> Result<()>
Copies the given file path to a file with the given name.
If the file already exists, a unique name is generated by appending a number to the base name.
Sourcepub fn log_test_result(&self, name: &str, r: &Result<()>)
pub fn log_test_result(&self, name: &str, r: &Result<()>)
Traces and logs the result of a test run in the format expected by our tooling.
Sourcepub fn output_dir(&self) -> &Path
pub fn output_dir(&self) -> &Path
Returns the output directory for log files.
Trait Implementations§
Source§impl Clone for PetriLogSource
impl Clone for PetriLogSource
Source§fn clone(&self) -> PetriLogSource
fn clone(&self) -> PetriLogSource
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for PetriLogSource
impl !RefUnwindSafe for PetriLogSource
impl Send for PetriLogSource
impl Sync for PetriLogSource
impl Unpin for PetriLogSource
impl !UnwindSafe for PetriLogSource
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