pub enum NamedAction {
Save {
name: String,
statement: String,
params: Vec<String>,
max_rows: Option<usize>,
},
List,
Remove {
name: String,
},
Run {
name: String,
args: Vec<String>,
},
}Expand description
What to do with a named statement.
The name and the statement text stay plain strings here, and the argument layer no longer demands them, so publishing the contract of any action costs nothing. The empty string stands for absence, because nothing can be kept, removed or run under an empty name, and the refusal is raised where the action is actually served.
Variants§
Save
Store a statement under a name.
Fields
List
List stored statements.
Remove
Delete a stored statement.
Run
Run a stored statement.
Implementations§
Source§impl NamedAction
impl NamedAction
Sourcepub const fn published_name(&self) -> &'static str
pub const fn published_name(&self) -> &'static str
The published name of this action, as the command map lists it.
Each action is a published command of its own, so each names itself.
Answering with the family name, as this once did, meant a caller asking
what query named run returns was told about query named instead.
Trait Implementations§
Source§impl Clone for NamedAction
impl Clone for NamedAction
Source§impl Debug for NamedAction
impl Debug for NamedAction
Source§impl FromArgMatches for NamedAction
impl FromArgMatches for NamedAction
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Subcommand for NamedAction
impl Subcommand for NamedAction
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for NamedAction
impl RefUnwindSafe for NamedAction
impl Send for NamedAction
impl Sync for NamedAction
impl Unpin for NamedAction
impl UnsafeUnpin for NamedAction
impl UnwindSafe for NamedAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more