pub enum Edit {
Show 15 variants
AddItem {
item: Item,
index: Option<usize>,
},
RemoveItem {
index: usize,
},
ReplaceItem {
index: usize,
item: Item,
},
RenameItem {
index: usize,
new_name: String,
},
SetFieldUnit {
index: usize,
unit: Option<String>,
},
SetFieldSupport {
index: usize,
support: FieldSupport,
},
SetFieldRepresentation {
index: usize,
representation: FieldRepresentation,
},
AddMaterialProperty {
index: usize,
property: NamedArg,
},
RemoveMaterialProperty {
index: usize,
name: String,
},
SetLawCondition {
index: usize,
condition: Expr,
},
SetLawConsequence {
index: usize,
consequence: Expr,
},
AddPrefix {
prefix: String,
iri: String,
},
RemovePrefix {
prefix: String,
},
AddRequires {
cap: CapSpec,
},
RemoveRequires {
id: String,
},
}Expand description
A structural edit operation on a Program.
Edits are typed — they operate on the AST structure, not on text. This is the core of projectional authoring: the structure is authoritative, text is derived.
Variants§
AddItem
Add a new top-level item at the end (or at a specific index).
RemoveItem
Remove the item at the given index.
ReplaceItem
Replace the item at the given index.
RenameItem
Rename a function, const, field, material, or law.
SetFieldUnit
Modify a field’s unit.
SetFieldSupport
Modify a field’s support.
SetFieldRepresentation
Modify a field’s representation.
AddMaterialProperty
Add a property to a material.
RemoveMaterialProperty
Remove a property from a material by name.
SetLawCondition
Set a law’s condition.
SetLawConsequence
Set a law’s consequence.
AddPrefix
Add a prefix declaration.
RemovePrefix
Remove a prefix declaration by prefix name.
AddRequires
Add a requires capability.
RemoveRequires
Remove a requires capability by id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Edit
impl RefUnwindSafe for Edit
impl Send for Edit
impl Sync for Edit
impl Unpin for Edit
impl UnsafeUnpin for Edit
impl UnwindSafe for Edit
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