#[non_exhaustive]pub enum EditCommand {
AddRuleSet {
path: String,
},
RemoveRuleSet {
index: usize,
},
UpdateField {
target: EditTarget,
path: String,
value: EditValue,
},
SetFallbackRespondDir {
path: String,
},
}Expand description
A structured edit to apply to the workspace.
§Why commands instead of free-form text edits
The brief (§6.1, §6.2) spells this out: free-form text edits are too coarse for a GUI that needs to reason about the change. Commands carry exactly the intent — “add rule set”, “update field at path” — which the apply-layer can validate before writing anything.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AddRuleSet
Add a rule-set file to the workspace.
RemoveRuleSet
Remove a rule-set file by its index in the list.
UpdateField
Update an editable field. target identifies which file; path
is the dotted TOML path inside that file.
SetFallbackRespondDir
Change the fallback respond dir.
Trait Implementations§
Source§impl Clone for EditCommand
impl Clone for EditCommand
Source§fn clone(&self) -> EditCommand
fn clone(&self) -> EditCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EditCommand
impl RefUnwindSafe for EditCommand
impl Send for EditCommand
impl Sync for EditCommand
impl Unpin for EditCommand
impl UnsafeUnpin for EditCommand
impl UnwindSafe for EditCommand
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