pub enum Patch {
Replace {
target: String,
with: CExpr,
},
Delete {
target: String,
},
WrapWith {
target: String,
wrapper: CExpr,
},
}Variants§
Replace
Replace the node at target with the given expression fragment.
Only CExpr nodes are supported (typed positions like type
expressions and patterns are out-of-scope for this op).
Delete
Delete a CExpr from a list-shaped parent. Currently supports
Block.statements[i]. Deleting the result expression of a Block
or any non-list parent is rejected.
WrapWith
Wrap the target expression with wrapper. The wrapper must
contain exactly one Var { name: "_HOLE_" } node, which is
substituted by the original target.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Patch
impl<'de> Deserialize<'de> for Patch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Patch
Auto Trait Implementations§
impl Freeze for Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnsafeUnpin for Patch
impl UnwindSafe for Patch
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