pub struct Confirm {
pub mutations: Vec<Mutation>,
pub typed_word: Option<String>,
pub entered: String,
}Expand description
What a confirmation is waiting for.
Fields§
§mutations: Vec<Mutation>Every mutation this confirmation covers, in the order they will run. One for an ordinary action, one per selected row for a batch.
typed_word: Option<String>When set, the reader must type this exactly before the action is allowed. Reserved for the operations where a single keypress is too cheap for what it does.
entered: StringWhat they have typed so far.
Implementations§
Source§impl Confirm
impl Confirm
pub fn new(mutation: Mutation) -> Self
Sourcepub fn batch(mutations: Vec<Mutation>) -> Self
pub fn batch(mutations: Vec<Mutation>) -> Self
A confirmation over several rows.
The word owed scales with what is at stake: destroying histories always costs the word, and a destructive batch costs the count, because one keypress is too cheap to end a dozen workflows at once.
Sourcepub fn first(&self) -> &Mutation
pub fn first(&self) -> &Mutation
The mutation that stands for the set: the first, which every other one matches in verb and namespace because a batch is one action over many rows.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn is_batch(&self) -> bool
pub fn is_batch(&self) -> bool
Whether this covers more than one row, which is what the heading has to say.
Sourcepub fn is_satisfied(&self) -> bool
pub fn is_satisfied(&self) -> bool
Whether pressing Enter now would go ahead.
Sourcepub fn caution(&self) -> Option<String>
pub fn caution(&self) -> Option<String>
Why a word is owed at all.
The renderer must not infer this from the word: “delete” is owed because a history is about to stop existing, a count is owed because one keypress is too cheap for the number of rows, and telling a reader that terminating destroys a history would be a lie in the one place that has to be exact.