pub enum EditAction {
Replace {
inline: InlineOptions,
find: String,
at: Option<String>,
story: Option<String>,
occurrence: Option<usize>,
all_matches: bool,
expect_count: Option<usize>,
payload: TextPayload,
},
Rewrite {
inline: InlineOptions,
at: String,
payload: TextPayload,
},
Insert {
inline: InlineOptions,
kind: String,
at: String,
before_text: Option<String>,
after_text: Option<String>,
edge: Option<String>,
position: Option<String>,
occurrence: Option<usize>,
payload: TextPayload,
},
Delete {
inline: InlineOptions,
at: String,
find: Option<String>,
whole_block: bool,
occurrence: Option<usize>,
},
Apply {
file: PathBuf,
plan: PathBuf,
allow_unbound_plan: bool,
delivery: DeliveryOptions,
},
}Expand description
The initial PlanV2 text action profile.
Variants§
Replace
Replace exact literal text; without –at, search one declared story.
Fields
inline: InlineOptionsFrozen policy and new-edit attribution.
all_matches: boolReplace every candidate; refuses when any two candidates overlap. Requires –expect-count.
payload: TextPayloadExact text and optional attached comment.
Rewrite
Set exact desired paragraph text; an empty value retains the paragraph.
Fields
inline: InlineOptionsFrozen policy and new-edit attribution.
payload: TextPayloadExact text and optional attached comment.
Insert
Insert an explicitly typed text or paragraph payload.
Fields
inline: InlineOptionsFrozen policy and new-edit attribution.
payload: TextPayloadExact text and optional attached comment.
Delete
Delete one exact range, or explicitly delete a whole paragraph.
Fields
inline: InlineOptionsFrozen policy and new-edit attribution.
Apply
Apply only: never record into, consume, or rewrite the plan.
Implementations§
Source§impl EditAction
impl EditAction
Sourcepub fn inline(&self) -> Option<&InlineOptions>
pub fn inline(&self) -> Option<&InlineOptions>
Inline policy, when this action compiles a new plan.
Sourcepub fn inline_mut(&mut self) -> Option<&mut InlineOptions>
pub fn inline_mut(&mut self) -> Option<&mut InlineOptions>
Inline policy, mutable, when this action compiles a new plan.
Whether -a was spelled for this action. edit apply has none:
the plan’s author is the signature.
Sourcepub fn payload(&self) -> Option<&TextPayload>
pub fn payload(&self) -> Option<&TextPayload>
Exact payload or resource input for actions with text.
Sourcepub fn delivery(&self) -> &DeliveryOptions
pub fn delivery(&self) -> &DeliveryOptions
Delivery options, independent of plan-owned policy.
Trait Implementations§
Source§impl Debug for EditAction
impl Debug for EditAction
Source§impl FromArgMatches for EditAction
impl FromArgMatches for EditAction
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>
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>
ArgMatches to self.Source§impl Serialize for EditAction
impl Serialize for EditAction
Source§impl Subcommand for EditAction
impl Subcommand for EditAction
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
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
Self can parse a specific subcommand