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§
Sourcefn destruction_description(&self) -> String
fn destruction_description(&self) -> String
Get a description of what will be destroyed/changed
Provided Methods§
Sourcefn confirm_destruction(&self) -> Result<bool>
fn confirm_destruction(&self) -> Result<bool>
Confirm the destructive operation with the user
Sourcefn create_backup(&self) -> Result<Option<String>>
fn create_backup(&self) -> Result<Option<String>>
Create a backup before the destructive operation