Skip to main content

Print

Trait Print 

Source
pub trait Print {
    // Required methods
    fn print_loading(&self, is_done: bool);
    fn print_running_test(
        &self,
        idents: &Vec<String>,
        ident: &String,
        is_done: bool,
        is_ok: bool,
    );
    fn print_empty_line(&self);
    fn print_successes(&self);
    fn print_failures(&self);
    fn print_test_result(
        &self,
        idents: &Vec<String>,
        ident: &String,
        test_result: &TestResult,
    ) -> Result<()>;
    fn print_test_counts(
        &self,
        passed_test_count: usize,
        failed_test_count: usize,
    );
    fn print_lf_for_error(&self);
}
Expand description

A printer trait.

The printer prints messages for a test result.

Required Methods§

Source

fn print_loading(&self, is_done: bool)

Prints the “Loading tests …” message.

Source

fn print_running_test( &self, idents: &Vec<String>, ident: &String, is_done: bool, is_ok: bool, )

Prints the test running with the test identifier.

This method prints “ok” for the test success or “FAILED” for the test failure if the test is done, otherwise “FAILED”.

Source

fn print_empty_line(&self)

Prints an empty line.

Source

fn print_successes(&self)

Prints the “Successes:” message.

Source

fn print_failures(&self)

Prints the “Failures:” message.

Source

fn print_test_result( &self, idents: &Vec<String>, ident: &String, test_result: &TestResult, ) -> Result<()>

Prints the test result with data from the standard output and the standard error.

Source

fn print_test_counts(&self, passed_test_count: usize, failed_test_count: usize)

Prints the number of passed tests and the number of failed tests.

Source

fn print_lf_for_error(&self)

Prints the newline character for an occurred error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§