Trait Destructive

Source
pub trait Destructive: Command {
    // Required method
    fn destruction_description(&self) -> String;

    // Provided methods
    fn confirm_destruction(&self) -> Result<bool> { ... }
    fn create_backup(&self) -> Result<Option<String>> { ... }
}
Expand description

Trait for commands that perform destructive operations

Required Methods§

Source

fn destruction_description(&self) -> String

Get a description of what will be destroyed/changed

Provided Methods§

Source

fn confirm_destruction(&self) -> Result<bool>

Confirm the destructive operation with the user

Source

fn create_backup(&self) -> Result<Option<String>>

Create a backup before the destructive operation

Implementors§