Struct dia_assert::Assert [] [src]

pub struct Assert { /* fields omitted */ }

Use this struct with Level to assert a user action.

Methods

impl Assert
[src]

[src]

Makes new instance.

  • custom_formats: currently Rust doesn't support runtime formatting. So it's impossible to provide you a simpler solution. This is a workaround: the first string will be placed before the generated-string to be displayed to the user. The second string will be placed after that. If you provide None, a pre-defined format will be used.

  • exit_code: will be passed to process::exit().

[src]

Tries an assert.

The function generates a string with difficulty based on level. Then asks the user to type that string.

[src]

Tries n times.

This function calls try().

  • If the user passed, it returns peacefully.
  • For other cases (the user fails, or stdout failure...), it calls process::exit() with the exit code you provided in ::new().

[src]

Tries once.

This function calls try_n() with 1 passed as n.

Trait Implementations

Auto Trait Implementations

impl Send for Assert

impl Sync for Assert