pub struct ReplaceCodeMutation {
pub symbol_id: SymbolId,
pub raw: String,
}Expand description
Replace an item by SymbolId with raw source bytes, routed through
PureItem::Verbatim so trivia (line comments, blank lines, DSL macro
spacing) survives the codegen round-trip.
This is the producer side of the β-route ReplaceCode escape hatch:
the executor finds the parent module of symbol_id, locates the item
position, and substitutes it with a PureItem::Verbatim(raw) which
PureFile::to_source lays out via stub + splice.
Fields§
§symbol_id: SymbolIdSymbolId of the item to replace.
raw: StringRaw replacement bytes, preserved verbatim.
Implementations§
Trait Implementations§
Source§impl Clone for ReplaceCodeMutation
impl Clone for ReplaceCodeMutation
Source§fn clone(&self) -> ReplaceCodeMutation
fn clone(&self) -> ReplaceCodeMutation
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 moreSource§impl Debug for ReplaceCodeMutation
impl Debug for ReplaceCodeMutation
Source§impl Mutation for ReplaceCodeMutation
impl Mutation for ReplaceCodeMutation
Source§fn mutation_type(&self) -> &'static str
fn mutation_type(&self) -> &'static str
Get the mutation type name
Source§fn validate(&self, _file: &PureFile) -> ValidationResult
fn validate(&self, _file: &PureFile) -> ValidationResult
Validate the mutation before applying Read more
Source§fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
Check if this mutation can proceed with the given strategy
Auto Trait Implementations§
impl Freeze for ReplaceCodeMutation
impl RefUnwindSafe for ReplaceCodeMutation
impl Send for ReplaceCodeMutation
impl Sync for ReplaceCodeMutation
impl Unpin for ReplaceCodeMutation
impl UnsafeUnpin for ReplaceCodeMutation
impl UnwindSafe for ReplaceCodeMutation
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