pub struct AllureWriter { /* private fields */ }Expand description
Writer for Allure test result files.
Implementations§
Source§impl AllureWriter
impl AllureWriter
Sourcepub fn new() -> AllureWriter
pub fn new() -> AllureWriter
Creates a new writer with the default results directory.
Sourcepub fn with_results_dir(path: impl AsRef<Path>) -> AllureWriter
pub fn with_results_dir(path: impl AsRef<Path>) -> AllureWriter
Creates a new writer with a custom results directory.
Sourcepub fn results_dir(&self) -> &Path
pub fn results_dir(&self) -> &Path
Returns the results directory path.
Sourcepub fn init(&self, clean: bool) -> Result<(), Error>
pub fn init(&self, clean: bool) -> Result<(), Error>
Initializes the results directory, optionally cleaning it first.
Sourcepub fn write_test_result(&self, result: &TestResult) -> Result<PathBuf, Error>
pub fn write_test_result(&self, result: &TestResult) -> Result<PathBuf, Error>
Writes a test result to a JSON file.
Sourcepub fn write_container(
&self,
container: &TestResultContainer,
) -> Result<PathBuf, Error>
pub fn write_container( &self, container: &TestResultContainer, ) -> Result<PathBuf, Error>
Writes a container to a JSON file.
Sourcepub fn write_text_attachment(
&self,
name: impl Into<String>,
content: impl AsRef<str>,
) -> Result<Attachment, Error>
pub fn write_text_attachment( &self, name: impl Into<String>, content: impl AsRef<str>, ) -> Result<Attachment, Error>
Writes a text attachment and returns the Attachment reference.
Sourcepub fn write_json_attachment<T>(
&self,
name: impl Into<String>,
value: &T,
) -> Result<Attachment, Error>where
T: Serialize,
pub fn write_json_attachment<T>(
&self,
name: impl Into<String>,
value: &T,
) -> Result<Attachment, Error>where
T: Serialize,
Writes a JSON attachment and returns the Attachment reference.
Sourcepub fn write_binary_attachment(
&self,
name: impl Into<String>,
content: &[u8],
content_type: ContentType,
) -> Result<Attachment, Error>
pub fn write_binary_attachment( &self, name: impl Into<String>, content: &[u8], content_type: ContentType, ) -> Result<Attachment, Error>
Writes a binary attachment and returns the Attachment reference.
Sourcepub fn write_binary_attachment_with_mime(
&self,
name: impl Into<String>,
content: &[u8],
mime_type: impl Into<String>,
extension: impl AsRef<str>,
) -> Result<Attachment, Error>
pub fn write_binary_attachment_with_mime( &self, name: impl Into<String>, content: &[u8], mime_type: impl Into<String>, extension: impl AsRef<str>, ) -> Result<Attachment, Error>
Writes a binary attachment with a custom MIME type.
Sourcepub fn copy_file_attachment(
&self,
name: impl Into<String>,
source_path: impl AsRef<Path>,
content_type: Option<ContentType>,
) -> Result<Attachment, Error>
pub fn copy_file_attachment( &self, name: impl Into<String>, source_path: impl AsRef<Path>, content_type: Option<ContentType>, ) -> Result<Attachment, Error>
Copies a file as an attachment and returns the Attachment reference.
Trait Implementations§
Source§impl Clone for AllureWriter
impl Clone for AllureWriter
Source§fn clone(&self) -> AllureWriter
fn clone(&self) -> AllureWriter
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AllureWriter
impl Debug for AllureWriter
Source§impl Default for AllureWriter
impl Default for AllureWriter
Source§fn default() -> AllureWriter
fn default() -> AllureWriter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AllureWriter
impl RefUnwindSafe for AllureWriter
impl Send for AllureWriter
impl Sync for AllureWriter
impl Unpin for AllureWriter
impl UnwindSafe for AllureWriter
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)