pub enum CommitActionKind {
CheckoutDetached,
CreateBranchHere,
CherryPick,
Revert,
RebaseOnto,
ResetSoft,
ResetMixed,
ResetHard,
CreateTag,
CreateAnnotatedTag,
}Expand description
Discriminant-only commit action — used for building menus before
input values are known. Every variant maps 1-to-1 to a
CommitAction variant.
Variants§
CheckoutDetached
CreateBranchHere
CherryPick
Revert
RebaseOnto
ResetSoft
ResetMixed
ResetHard
CreateTag
CreateAnnotatedTag
Implementations§
Source§impl CommitActionKind
impl CommitActionKind
Sourcepub fn input_prompt(self) -> Option<&'static str>
pub fn input_prompt(self) -> Option<&'static str>
Prompt to show when this action needs a first user-supplied
string (e.g. branch name, tag name). None for actions that
need no input.
Sourcepub fn second_input_prompt(self) -> Option<&'static str>
pub fn second_input_prompt(self) -> Option<&'static str>
Prompt to show when this action needs a second string
(e.g. annotated-tag message). None for most actions.
Sourcepub fn needs_input(self) -> bool
pub fn needs_input(self) -> bool
Whether this action requires at least one string from the user before it can execute.
Sourcepub fn needs_second_input(self) -> bool
pub fn needs_second_input(self) -> bool
Whether this action requires a second string.
Sourcepub fn into_action(self, input1: String, input2: String) -> CommitAction
pub fn into_action(self, input1: String, input2: String) -> CommitAction
Build the corresponding CommitAction from this kind plus up
to two collected input strings. Pass empty strings for inputs
that are not used by this variant.
Sourcepub fn as_simple_action(self) -> Option<CommitAction>
pub fn as_simple_action(self) -> Option<CommitAction>
Convenience: build a CommitAction for variants that need no
user input. Returns None for input-needing variants.
Trait Implementations§
Source§impl Clone for CommitActionKind
impl Clone for CommitActionKind
Source§fn clone(&self) -> CommitActionKind
fn clone(&self) -> CommitActionKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CommitActionKind
Source§impl Debug for CommitActionKind
impl Debug for CommitActionKind
impl Eq for CommitActionKind
Source§impl Hash for CommitActionKind
impl Hash for CommitActionKind
Source§impl PartialEq for CommitActionKind
impl PartialEq for CommitActionKind
Source§fn eq(&self, other: &CommitActionKind) -> bool
fn eq(&self, other: &CommitActionKind) -> bool
self and other values to be equal, and is used by ==.