Skip to main content

Confirm

Trait Confirm 

Source
pub trait Confirm {
    // Required method
    fn confirm(&mut self, warning: &Warning) -> Result<bool>;
}
Expand description

Decides whether the irreversible half of lock may go ahead.

An injected decision rather than a flag, so the interactive path is exercised by tests instead of being the one branch nothing covers.

Required Methods§

Source

fn confirm(&mut self, warning: &Warning) -> Result<bool>

Presents warning and answers whether to proceed.

§Errors

Error::Io when the warning cannot be shown or the answer cannot be read. Refusing is the safe default, so a failure here must not be turned into a yes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<R: BufRead, W: Write> Confirm for Ask<R, W>

Source§

impl<W: Write> Confirm for Assumed<W>