Enum biir::utils::Output[][src]

pub enum Output {
    Stdout(Stdout),
    Vector(Vec<String>),
}
Expand description

common interface for writing to stdout as well as Vector, to allow integration tests

Variants

Stdout(Stdout)
Vector(Vec<String>)

Implementations

return string of everyting that has been written

use biir::utils::Output;

let mut output = Output::Vector(Vec::new());

output.write("Hello, ".to_string());
output.write("world!".to_string());

assert_eq!(output.read(), "Hello, world!");

panic when used with Output::Stdout

use biir::utils::Output;

let mut output = Output::Stdout(std::io::stdout());
let result = std::panic::catch_unwind(|| output.read());

assert!(result.is_err());

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.